This commit is contained in:
luofei 2023-05-18 14:24:40 +08:00
commit c17fbca1b3

View File

@ -165,7 +165,13 @@ class SpuRepository extends BaseRepository
$count = $query->count();
// $Sql=$query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->fetchSql(true);
$list = $query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->select();
$query->with([
'merchant' => function ($query) {
$query->field($this->merchantFiled)->with(['type_name']);
},
'issetCoupon',
]);
$list = $query->page($page, $limit)->setOption('field', [])->field($this->productFiled)->orderRaw('rand()')->select();
$append = ['stop_time','svip_price','show_svip_info','is_svip_price'];
$list->append($append);