|
@@ -9,6 +9,7 @@ namespace app\models\store;
|
|
|
|
|
|
|
|
use app\admin\model\store\StoreProductAttrValue;
|
|
use app\admin\model\store\StoreProductAttrValue;
|
|
|
use app\admin\model\system\SystemGroupData;
|
|
use app\admin\model\system\SystemGroupData;
|
|
|
|
|
+use app\admin\model\system\SystemStoreProductStock;
|
|
|
use crmeb\basic\BaseModel;
|
|
use crmeb\basic\BaseModel;
|
|
|
use crmeb\services\UtilService;
|
|
use crmeb\services\UtilService;
|
|
|
use crmeb\traits\ModelTrait;
|
|
use crmeb\traits\ModelTrait;
|
|
@@ -166,7 +167,7 @@ class StoreCart extends BaseModel
|
|
|
return self::where('uid', $uid)->where('id', $cartId)->update(['cart_num' => $cartNum]);
|
|
return self::where('uid', $uid)->where('id', $cartId)->update(['cart_num' => $cartNum]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function getUserProductCartList($uid, $cartIds = '', $status = 0)
|
|
|
|
|
|
|
+ public static function getUserProductCartList($uid, $cartIds = '', $status = 0, $store_id = 0)
|
|
|
{
|
|
{
|
|
|
$productInfoField = 'id,image,price,ot_price,vip_price,postage,give_integral,sales,stock,store_name,unit_name,is_show,is_del,is_postage,cost,is_sub,temp_id,store_type';
|
|
$productInfoField = 'id,image,price,ot_price,vip_price,postage,give_integral,sales,stock,store_name,unit_name,is_show,is_del,is_postage,cost,is_sub,temp_id,store_type';
|
|
|
$seckillInfoField = 'id,image,price,ot_price,postage,give_integral,sales,stock,title as store_name,unit_name,is_show,is_del,is_postage,cost,temp_id,weight,volume,start_time,stop_time,time_id';
|
|
$seckillInfoField = 'id,image,price,ot_price,postage,give_integral,sales,stock,title as store_name,unit_name,is_show,is_del,is_postage,cost,temp_id,weight,volume,start_time,stop_time,time_id';
|
|
@@ -246,6 +247,10 @@ class StoreCart extends BaseModel
|
|
|
if (!$attrInfo || !$attrInfo['stock'])
|
|
if (!$attrInfo || !$attrInfo['stock'])
|
|
|
$invalid[] = $cart;
|
|
$invalid[] = $cart;
|
|
|
else {
|
|
else {
|
|
|
|
|
+ if ($store_id) {
|
|
|
|
|
+ $stock_info = SystemStoreProductStock::where('store_id', $store_id)->where('unique', $cart['product_attr_unique'])->where('product_id', $cart['productInfo']['id'])->find();
|
|
|
|
|
+ if ($stock_info) $attrInfo['price'] = $stock_info['price'];
|
|
|
|
|
+ }
|
|
|
$cart['productInfo']['attrInfo'] = $attrInfo;
|
|
$cart['productInfo']['attrInfo'] = $attrInfo;
|
|
|
if ($cart['combination_id'] || $cart['seckill_id'] || $cart['bargain_id'] || $cart['integral_id']) {
|
|
if ($cart['combination_id'] || $cart['seckill_id'] || $cart['bargain_id'] || $cart['integral_id']) {
|
|
|
$cart['truePrice'] = $attrInfo['price'];
|
|
$cart['truePrice'] = $attrInfo['price'];
|