修改收银台商品价格计算

This commit is contained in:
DESKTOP-GMUNQ1B\Administrator 2024-12-06 16:37:47 +08:00
parent c91434d54f
commit 9f68846caf

View File

@ -9,6 +9,7 @@ use app\common\model\order\Cart;
use app\common\model\Config;
use app\common\model\store_branch_product\StoreBranchProduct;
use app\common\model\store_product_attr_value\StoreProductAttrValue;
use app\common\model\store_product_group_price\StoreProductGroupPrice;
use app\common\model\store_product_unit\StoreProductUnit;
use app\common\model\user\User;
use app\common\lists\ListsExtendInterface;
@ -66,15 +67,16 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
$user_ship=0;
if ($uid > 0) {
$user_ship = User::where('id', $uid)->value('user_ship');
if (in_array($user_ship, [4, 6, 7])) {
$off_activity = 1;
}
// if (in_array($user_ship, [4, 6, 7])) {
// $off_activity = 1;
// }
}
foreach ($list as $key => &$item) {
$find = StoreProduct::where(['id' => $item['product_id']])
->field('id,id product_id,image,price,cost,store_name,unit,delete_time,vip_price,top_cate_id')
->find();
if ($find) {
$find = StoreProductGroupPrice::resetProductPrice($find, $user_ship);
if ($off_activity == 1) {
$this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2);
$item['price'] = $find['cost'];