作者 lyh

gx

@@ -12,6 +12,7 @@ use App\Models\Product\CategoryRelated; @@ -12,6 +12,7 @@ use App\Models\Product\CategoryRelated;
12 use App\Models\Product\KeywordRelated; 12 use App\Models\Product\KeywordRelated;
13 use App\Rules\Ids; 13 use App\Rules\Ids;
14 use Illuminate\Http\Request; 14 use Illuminate\Http\Request;
  15 +use Illuminate\Support\Facades\DB;
15 16
16 /** 17 /**
17 * Class ProductController 18 * Class ProductController
@@ -55,7 +56,8 @@ class ProductController extends BaseController @@ -55,7 +56,8 @@ class ProductController extends BaseController
55 $map[] = ['status', $this->param['status']]; 56 $map[] = ['status', $this->param['status']];
56 } 57 }
57 $sort = ['id' => 'desc']; 58 $sort = ['id' => 'desc'];
58 - $data = $logic->getList($map, $sort, ['id', 'project_id', 'title', 'thumb', 'product_type' , 'route' ,'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at'],$this->row); 59 + $data = DB::table('gl_product')->where(['project_id'=>$this->param['project_id']])->paginate($this->row);
  60 +// $data = $logic->getList($map, $sort, ['id', 'project_id', 'title', 'thumb', 'product_type' , 'route' ,'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at'],$this->row);
59 return $this->success($data); 61 return $this->success($data);
60 } 62 }
61 63
@@ -30,10 +30,10 @@ class ProductLogic extends BaseLogic @@ -30,10 +30,10 @@ class ProductLogic extends BaseLogic
30 public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $row = 20) 30 public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $row = 20)
31 { 31 {
32 $data = parent::getList($map, $sort, $columns, $row); 32 $data = parent::getList($map, $sort, $columns, $row);
33 -// foreach ($data['list'] as &$v){  
34 -// $v = $this->formatData($v);  
35 -// $v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一  
36 -// } 33 + foreach ($data['list'] as &$v){
  34 + $v = $this->formatData($v);
  35 + $v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一
  36 + }
37 return $this->success($data); 37 return $this->success($data);
38 } 38 }
39 39