1
This commit is contained in:
parent
c73f829e26
commit
f2c4813809
@ -23,6 +23,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
|||||||
protected $total_price = 0;
|
protected $total_price = 0;
|
||||||
protected $activity_price = 0;
|
protected $activity_price = 0;
|
||||||
protected $off_activity = 0;
|
protected $off_activity = 0;
|
||||||
|
protected $pay_price = 0;
|
||||||
/**
|
/**
|
||||||
* @notes 设置搜索条件
|
* @notes 设置搜索条件
|
||||||
* @return \string[][]
|
* @return \string[][]
|
||||||
@ -72,7 +73,6 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
|||||||
->field('product_id,image,price,cost,store_name,unit,delete_time,vip_price')
|
->field('product_id,image,price,cost,store_name,unit,delete_time,vip_price')
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
if ($find) {
|
if ($find) {
|
||||||
if ($off_activity == 1) {
|
if ($off_activity == 1) {
|
||||||
$this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2);
|
$this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2);
|
||||||
@ -80,8 +80,10 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
|||||||
} else {
|
} else {
|
||||||
$item['price'] = $find['price'];
|
$item['price'] = $find['price'];
|
||||||
}
|
}
|
||||||
$item['goods_total_price'] = bcmul($item['cart_num'], $find['price'], 2);
|
$item['pay_price'] = bcmul($item['cart_num'], $item['price'], 2);
|
||||||
$this->total_price = bcadd($this->total_price, $item['goods_total_price'], 2);
|
$item['total_price'] = bcmul($item['cart_num'], $find['price'], 2);
|
||||||
|
$this->total_price = bcadd($this->total_price, $item['total_price'], 2);
|
||||||
|
$this->pay_price = bcadd($this->pay_price, $item['pay_price'], 2);
|
||||||
$item['image'] = $find['image'];
|
$item['image'] = $find['image'];
|
||||||
$item['cost'] = $find['cost'];
|
$item['cost'] = $find['cost'];
|
||||||
$item['store_name'] = $find['store_name'];
|
$item['store_name'] = $find['store_name'];
|
||||||
@ -114,7 +116,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
|||||||
'off_activity' => $this->off_activity,
|
'off_activity' => $this->off_activity,
|
||||||
'total_price' => $this->total_price,
|
'total_price' => $this->total_price,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'pay_price' => $this->total_price
|
'pay_price' => $this->pay_price
|
||||||
];
|
];
|
||||||
if ($this->off_activity == 1) {
|
if ($this->off_activity == 1) {
|
||||||
$data['pay_price'] = $this->activity_price;
|
$data['pay_price'] = $this->activity_price;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user