添加店铺商品标签列表,商品列表添加按兑换比例查询

This commit is contained in:
luofei 2024-02-26 15:11:17 +08:00
parent 0b734cc620
commit 55163e82b0
3 changed files with 18 additions and 1 deletions

View File

@ -11,6 +11,7 @@
namespace app\common\dao\store\product;
use app\common\dao\BaseDao;
use app\common\model\store\product\ProductAttrValue;
use app\common\model\store\product\ProductCate;
use app\common\model\store\product\Spu;
use app\common\model\store\StoreCategory;
@ -199,6 +200,12 @@ class SpuDao extends BaseDao
->when(isset($where['svip']) && $where['svip'] !== '',function($query)use($where){
$query->where('svip_price_type','>',0)->where('mer_svip_status',1);
})
->when(isset($where['exchange_rate']) && $where['exchange_rate'] !== '',function($query)use($where){
$productIds = ProductAttrValue::where('profit_rate', $where['exchange_rate'])->column('product_id');
if (!empty($productIds)) {
$query->whereIn('product_id', $productIds);
}
})
;
return $query->order($order);
}

View File

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\controller\api\store\product;
use app\common\model\store\product\ProductLabel;
use app\common\repositories\store\product\ProductRepository;
use app\common\repositories\store\StoreCategoryRepository;
use app\common\repositories\system\merchant\MerchantRepository;
@ -58,7 +59,8 @@ class StoreSpu extends BaseController
'product_ids',
'mer_id',
'filter_params',
'mer_type_id'
'mer_type_id',
'exchange_rate'
]);
$where['is_gift_bag'] = 0;
$where['product_type'] = 0;
@ -288,5 +290,11 @@ class StoreSpu extends BaseController
return app('json')->success($data);
}
public function storeLabel()
{
$merId = $this->request->get('mer_id');
$list = ProductLabel::where('mer_id', $merId)->select()->toArray();
return app('json')->success($list);
}
}

View File

@ -473,6 +473,8 @@ Route::group('api/', function () {
Route::get('/active/category/:type', 'StoreSpu/activeCategory');
//标签获取数据
Route::get('/labels', 'StoreSpu/labelsLst');
//店铺商品标签列表
Route::get('/storeLabel', 'StoreSpu/storeLabel');
//本地生活商品
Route::get('/local/:id', 'StoreSpu/local');
//复制口令