作者 lyh

gx

... ... @@ -12,6 +12,7 @@ use App\Models\Product\CategoryRelated;
use App\Models\Product\KeywordRelated;
use App\Rules\Ids;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
/**
* Class ProductController
... ... @@ -55,7 +56,8 @@ class ProductController extends BaseController
$map[] = ['status', $this->param['status']];
}
$sort = ['id' => 'desc'];
$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);
$data = DB::table('gl_product')->where(['project_id'=>$this->param['project_id']])->paginate($this->row);
// $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);
return $this->success($data);
}
... ...
... ... @@ -30,10 +30,10 @@ class ProductLogic extends BaseLogic
public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $row = 20)
{
$data = parent::getList($map, $sort, $columns, $row);
// foreach ($data['list'] as &$v){
// $v = $this->formatData($v);
// $v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一
// }
foreach ($data['list'] as &$v){
$v = $this->formatData($v);
$v['thumb']['image_link'] = getImageUrl($v['thumb']['url']);//图片统一
}
return $this->success($data);
}
... ...