本帖最后由 liusonglin 于 2020-7-10 19:14 编辑
一、找到文件app/admin/controller/order/StoreOrder.php
34行后 加上一行use引用
use app\models\store\StoreOrder as StoreOrderModels;
629行后加上回退库存方法调用
//回退库存 StoreOrderModels::RegressionStock($product);
833行加上回退库存方法调用
StoreOrderModels::RegressionStock($product);
二、找到文件
app/models/store/StoreOrder.php
504修改为
if ($order['status'] == -2 || $order['is_del']) return true;
511行修改代码
foreach ($cartInfo as $cart) { //增库存减销量 if ($combinationId) $res5 = $res5 && StoreCombination::incCombinationStock($cart['cart_info']['cart_num'], $combinationId, isset($cart['cart_info']['productInfo']['attrInfo']) ? $cart['cart_info']['productInfo']['attrInfo']['unique'] : ''); else if ($seckill_id) $res5 = $res5 && StoreSeckill::incSeckillStock($cart['cart_info']['cart_num'], $seckill_id, isset($cart['cart_info']['productInfo']['attrInfo']) ? $cart['cart_info']['productInfo']['attrInfo']['unique'] : ''); else if ($bargain_id) $res5 = $res5 && StoreBargain::incBargainStock($cart['cart_info']['cart_num'], $bargain_id, isset($cart['cart_info']['productInfo']['attrInfo']) ? $cart['cart_info']['productInfo']['attrInfo']['unique'] : ''); else $res5 = $res5 && StoreProduct::incProductStock($cart['cart_info']['cart_num'], $cart['cart_info']['productInfo']['id'], isset($cart['cart_info']['productInfo']['attrInfo']) ? $cart['cart_info']['productInfo']['attrInfo']['unique'] : ''); }
三、找到文件app\admin\model\order\StoreOrder.php
42行添加代码
protected function getCartIdAttr($value) { return json_decode($value, true); }
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}