Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
982b9c3b46
@ -110,7 +110,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
'off_activity' => $this->off_activity,
|
||||
'total_price' => $this->total_price,
|
||||
'msg' => '',
|
||||
'pay_price' => bcsub($this->total_price, $this->activity_price, 2)
|
||||
'pay_price' => $this->total_price
|
||||
];
|
||||
if($this->off_activity==1){
|
||||
$data['pay_price']=$this->activity_price;
|
||||
|
@ -57,9 +57,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
->toArray();
|
||||
$off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
$this->off_activity = $off_activity;
|
||||
$user = User::where('id', $userId)->find();
|
||||
foreach ($list as $key => &$item) {
|
||||
|
||||
$find = StoreBranchProduct::where(['product_id' => $item['product_id'], 'store_id' => $item['store_id']])
|
||||
->field('product_id,image,price,cost,store_name,unit,delete_time,vip_price')
|
||||
->withTrashed()
|
||||
@ -68,20 +66,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
if ($find) {
|
||||
if ($off_activity == 1) {
|
||||
$this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2);
|
||||
} else {
|
||||
if ($user && $user['user_ship'] == 1) {
|
||||
//更新 会员为1的时候原价减去会员价
|
||||
$deduction_price_count = bcmul(bcsub($find['price'], $find['vip_price'], 2), $item['cart_num'], 2);
|
||||
$this->activity_price = bcadd($this->activity_price, $deduction_price_count, 2);
|
||||
} elseif ($user && $user['user_ship'] == 4) {
|
||||
//更新 为4商户的时候减去商户价格
|
||||
$deduction_price_count = bcmul(bcsub($find['price'], $find['cost'], 2), $item['cart_num'], 2);
|
||||
$this->activity_price = bcadd($this->activity_price, $deduction_price_count, 2);
|
||||
} else {
|
||||
$this->activity_price = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$item['goods_total_price'] = bcmul($item['cart_num'], $find['price'], 2);
|
||||
$this->total_price = bcadd($this->total_price, $item['goods_total_price'], 2);
|
||||
$item['image'] = $find['image'];
|
||||
@ -117,7 +102,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
'off_activity' => $this->off_activity,
|
||||
'total_price' => $this->total_price,
|
||||
'msg' => '',
|
||||
'pay_price' => bcsub($this->total_price, $this->activity_price, 2)
|
||||
'pay_price' => $this->total_price
|
||||
];
|
||||
if ($this->off_activity == 1) {
|
||||
$data['pay_price'] = $this->activity_price;
|
||||
|
Loading…
x
Reference in New Issue
Block a user