settter
							parent
							
								
									0e8ead43e0
								
							
						
					
					
						commit
						a6323a8958
					
				|  | @ -232,7 +232,7 @@ class Consumer extends Base | ||||||
|                 throw new ValidateException('用户无效!'); |                 throw new ValidateException('用户无效!'); | ||||||
|             } |             } | ||||||
|             $data = AccountRepository::getInstance()->getBusinessFlowList($account->user_code,$page,$size,$keyword); |             $data = AccountRepository::getInstance()->getBusinessFlowList($account->user_code,$page,$size,$keyword); | ||||||
|             $data->each(function ($item){ |             $data["list"]->each(function ($item){ | ||||||
|                 $item->businessCover = $this->request->domain() . $item->background; |                 $item->businessCover = $this->request->domain() . $item->background; | ||||||
|             }); |             }); | ||||||
|             return $this->json(0,"success",$data); |             return $this->json(0,"success",$data); | ||||||
|  |  | ||||||
|  | @ -3,6 +3,7 @@ | ||||||
| namespace app\traits\account; | namespace app\traits\account; | ||||||
| 
 | 
 | ||||||
| use app\model\BusinessFlow; | use app\model\BusinessFlow; | ||||||
|  | use think\Collection; | ||||||
| 
 | 
 | ||||||
| trait BusinessFlowTrait | trait BusinessFlowTrait | ||||||
| { | { | ||||||
|  | @ -16,9 +17,15 @@ trait BusinessFlowTrait | ||||||
|      */ |      */ | ||||||
|     public function getBusinessFlowList($accountCode, $page, $size,$keyword=null) |     public function getBusinessFlowList($accountCode, $page, $size,$keyword=null) | ||||||
|     { |     { | ||||||
|         return BusinessFlow::alias("a") |         $data = [ | ||||||
|             ->join("business b","a.business_code = b.code") |             'total' => 0, | ||||||
|             ->where("a.user_code",$accountCode) |             'current' => $page, | ||||||
|  |             'size' => $size, | ||||||
|  |             'list' => new Collection(), | ||||||
|  |         ]; | ||||||
|  |         $model = BusinessFlow::alias("a") | ||||||
|  |             ->join("business b", "a.business_code = b.code") | ||||||
|  |             ->where("a.user_code", $accountCode) | ||||||
|             ->when(!empty($keyword), function ($q) use ($keyword) { |             ->when(!empty($keyword), function ($q) use ($keyword) { | ||||||
|                 $q->where("b.business_name", "like", "%{$keyword}%"); |                 $q->where("b.business_name", "like", "%{$keyword}%"); | ||||||
|             }) |             }) | ||||||
|  | @ -29,10 +36,13 @@ trait BusinessFlowTrait | ||||||
|                 "b.background", |                 "b.background", | ||||||
|                 "a.create_time as createTime", |                 "a.create_time as createTime", | ||||||
|                 "a.user_code as userCode", |                 "a.user_code as userCode", | ||||||
|             ]) |             ]); | ||||||
|             ->page($page,$size) |         $data["total"] = $model->count(); | ||||||
|  |         $data["list"] = $model | ||||||
|  |             ->page($page, $size) | ||||||
|             ->order("a.id desc") |             ->order("a.id desc") | ||||||
|             ->select(); |             ->select(); | ||||||
|  |         return $data; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue