作者 jiawen
1 个管道 的构建 通过 耗费 0 秒

产品列表调试

@@ -61,6 +61,9 @@ class ProductController extends RestBaseController @@ -61,6 +61,9 @@ class ProductController extends RestBaseController
61 $per_page = $data['per_page'] ? : config('per_page'); 61 $per_page = $data['per_page'] ? : config('per_page');
62 $condition['p.type'] = 1;//上架产品 62 $condition['p.type'] = 1;//上架产品
63 $condition['c.user_id'] = $data['user_id']; 63 $condition['c.user_id'] = $data['user_id'];
  64 + if ($data['company']) {
  65 + $condition['p.job'] = $data['company'];
  66 + }
64 if ($data['policy']) { 67 if ($data['policy']) {
65 $condition['p.policy'] = $data['policy']; 68 $condition['p.policy'] = $data['policy'];
66 } 69 }
@@ -74,7 +77,7 @@ class ProductController extends RestBaseController @@ -74,7 +77,7 @@ class ProductController extends RestBaseController
74 ->where($condition) 77 ->where($condition)
75 ->field('p.id,p.name,p.logo,p.upper_limit,p.lower_limit,p.rate,p.loan_time,p.loan_period,c.company') 78 ->field('p.id,p.name,p.logo,p.upper_limit,p.lower_limit,p.rate,p.loan_time,p.loan_period,c.company')
76 ->order('p.create_time desc') 79 ->order('p.create_time desc')
77 - ->paginate($per_page); 80 + ->select(false);
78 if ($result === false) { 81 if ($result === false) {
79 $this->error(['code'=>'40000','msg'=>'获取失败']); 82 $this->error(['code'=>'40000','msg'=>'获取失败']);
80 } 83 }