|
|
@@ -42,7 +42,7 @@ class StoreCart extends BaseModel
|
|
|
return date("Y-m-d H:i:s");
|
|
|
}
|
|
|
|
|
|
- public static function setCart($uid, $product_id, $cart_num = 1, $product_attr_unique = '', $type = 'product', $is_new = 0, $combination_id = 0, $seckill_id = 0, $bargain_id = 0, $is_consumer = 0)
|
|
|
+ public static function setCart($uid, $product_id, $cart_num = 1, $product_attr_unique = '', $type = 'product', $is_new = 0, $combination_id = 0, $seckill_id = 0, $bargain_id = 0, $is_consumer = 0, $store_id = 0)
|
|
|
{
|
|
|
if ($cart_num < 0.001) $cart_num = 1;
|
|
|
if (!$product_attr_unique) {
|
|
|
@@ -118,7 +118,7 @@ class StoreCart extends BaseModel
|
|
|
$id = self::getkeytoid('cart_id');
|
|
|
$is_suit = (!$combination_id && !$seckill_id && !$bargain_id && StoreProduct::where('id', $product_id)->value('is_suit')) ? 1 : 0;
|
|
|
$is_award = (!$combination_id && !$seckill_id && !$bargain_id && StoreProduct::where('id', $product_id)->value('is_award')) ? 1 : 0;
|
|
|
- $rs = self::create(compact('uid', 'is_award', 'product_id', 'cart_num', 'product_attr_unique', 'is_new', 'type', 'combination_id', 'add_time', 'bargain_id', 'seckill_id', 'id', 'is_consumer', 'is_suit'));
|
|
|
+ $rs = self::create(compact('uid', 'is_award', 'product_id', 'cart_num', 'product_attr_unique', 'is_new', 'type', 'combination_id', 'add_time', 'bargain_id', 'seckill_id', 'id', 'is_consumer', 'is_suit', 'store_id'));
|
|
|
@file_put_contents("cart.txt", self::getlastsql(), 8);
|
|
|
return $rs;
|
|
|
}
|
|
|
@@ -175,7 +175,7 @@ class StoreCart extends BaseModel
|
|
|
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,is_consumer,is_suit,max_use_integral,store_id,store_bag';
|
|
|
$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';
|
|
|
@@ -189,6 +189,7 @@ class StoreCart extends BaseModel
|
|
|
->where('c.is_del', 0);
|
|
|
if (!$status) $model = $model->where('c.is_new', 0);
|
|
|
if ($cartIds) $model = $model->where('c.id', 'IN', $cartIds);
|
|
|
+ if ($store_id) $model = $model->where('c.store_id', 'IN', $store_id);
|
|
|
$model = $model->order('c.add_time DESC');
|
|
|
$list = $model->select()->toArray();
|
|
|
if (!count($list)) return compact('valid', 'invalid');
|