feat: 添加用户商品存储逻辑

This commit is contained in:
mkm 2024-06-28 10:22:46 +08:00
parent 266e93f527
commit b5e8e527fe
2 changed files with 8 additions and 39 deletions

View File

@ -98,6 +98,7 @@ class PayNotifyLogic extends BaseLogic
// self::descStock($order['id']); // self::descStock($order['id']);
// } // }
self::afterPay($order); self::afterPay($order);
UserProductStorageLogic::add($order);
if ($extra && $extra['store_id']) { if ($extra && $extra['store_id']) {
$params = [ $params = [
'verify_code' => $order['verify_code'], 'verify_code' => $order['verify_code'],
@ -197,6 +198,7 @@ class PayNotifyLogic extends BaseLogic
// } // }
// self::addUserSing($order); // self::addUserSing($order);
self::afterPay($order); self::afterPay($order);
UserProductStorageLogic::add($order);
if ($extra && $extra['store_id']) { if ($extra && $extra['store_id']) {
$params = [ $params = [
'verify_code' => $order['verify_code'], 'verify_code' => $order['verify_code'],
@ -399,6 +401,7 @@ class PayNotifyLogic extends BaseLogic
} }
$order->save(); $order->save();
self::afterPay($order, $extra['transaction_id']); self::afterPay($order, $extra['transaction_id']);
UserProductStorageLogic::add($order);
// self::addUserSing($order); // self::addUserSing($order);
self::dealProductLog($order); self::dealProductLog($order);
if ($order['shipping_type'] == 3) { if ($order['shipping_type'] == 3) {
@ -694,6 +697,7 @@ class PayNotifyLogic extends BaseLogic
throw new \Exception('订单保存出错'); throw new \Exception('订单保存出错');
} }
self::afterPay($order); self::afterPay($order);
UserProductStorageLogic::add($order);
$cashFlowLogic = new CashFlowLogic(); $cashFlowLogic = new CashFlowLogic();
$cashFlowLogic->insert($order['store_id'], $order['pay_price']); $cashFlowLogic->insert($order['store_id'], $order['pay_price']);
self::dealProductLog($order); self::dealProductLog($order);
@ -730,6 +734,7 @@ class PayNotifyLogic extends BaseLogic
if ($order->pay_type == 9) { if ($order->pay_type == 9) {
$order->status = 2; $order->status = 2;
self::afterPay($order); self::afterPay($order);
UserProductStorageLogic::add($order);
} }
self::dealProductLog($order); self::dealProductLog($order);
if ($order['shipping_type'] == 3) { if ($order['shipping_type'] == 3) {
@ -898,45 +903,6 @@ class PayNotifyLogic extends BaseLogic
} }
} }
if ($fees > 0) { if ($fees > 0) {
//村长获得
// $sing = [];
// $sing[] = [
// 'uid' => $village_uid,
// 'order_id' => $order['order_id'],
// 'title' => '村长订单获得兑换券',
// 'store_id' => $order['store_id'],
// 'number' => $fees,
// 'financial_pm' => 1,
// 'user_ship' => 2,
// ];
// $sing[] = [
// 'uid' => $brigade_uid,
// 'order_id' => $order['order_id'],
// 'title' => '队长订单获得兑换券',
// 'store_id' => $order['store_id'],
// 'number' => $fees,
// 'financial_pm' => 1,
// 'user_ship' => 3,
// ];
// $sing[] = [
// 'uid' => $village_uid,
// 'order_id' => $order['order_id'],
// 'title' => '订单扣除兑换券',
// 'store_id' => $order['store_id'],
// 'number' => $fees,
// 'financial_pm' => 0,
// 'user_ship' => 2,
// ];
// $sing[] = [
// 'uid' => $brigade_uid,
// 'order_id' => $order['order_id'],
// 'title' => '订单扣除兑换券',
// 'store_id' => $order['store_id'],
// 'number' => $fees,
// 'financial_pm' => 0,
// 'user_ship' => 3,
// ];
if ($village_uid > 0) { if ($village_uid > 0) {
// SystemStore::where('id', $village_uid)->inc('store_money', $fees)->update(); // SystemStore::where('id', $village_uid)->inc('store_money', $fees)->update();
$financeLogic->other_arr['vip_uid'] = $village_uid; $financeLogic->other_arr['vip_uid'] = $village_uid;

View File

@ -7,6 +7,9 @@ use app\common\model\store_order_cart_info\StoreOrderCartInfo;
use app\common\model\user_product_storage\UserProductStorage; use app\common\model\user_product_storage\UserProductStorage;
use app\common\model\user_product_storage_log\UserProductStorageLog; use app\common\model\user_product_storage_log\UserProductStorageLog;
/**
* 用户商品储存逻辑
*/
class UserProductStorageLogic extends BaseLogic class UserProductStorageLogic extends BaseLogic
{ {
public static function add($order){ public static function add($order){