OrderCheck.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\Store\common\logic\order\limit;
  3. use addons\Coupon\AddonConfig;
  4. use addons\Coupon\common\enums\AddonsCouponEnum;
  5. use addons\Coupon\common\models\AddonsCoupon;
  6. use addons\Coupon\common\models\AddonsCouponUserRelate;
  7. use addons\Store\common\enums\StoreEnum;
  8. use addons\Store\common\models\StoreCoupon;
  9. use addons\Store\common\models\StoreCouponUserRelate;
  10. use addons\Store\common\models\StoreExtra;
  11. use addons\Store\common\models\StoreGoodsCateRelate;
  12. use common\enums\AddonsEnum;
  13. use common\enums\StatusEnum;
  14. use common\globals\GlobalInvoke;
  15. use common\models\goods\GoodsCateRelate;
  16. use common\models\mall\MallAddons;
  17. use Exception;
  18. use yii\helpers\Json;
  19. use common\logic\order\marketing\BaseMarketing;
  20. /**
  21. * 下单检测
  22. * @Author bing
  23. * @DateTime 2022-12-2 19:07:32
  24. * @copyright: Copyright (c) 2020 广东七件事集团
  25. */
  26. class OrderCheck extends BaseMarketing
  27. {
  28. public function execute($form)
  29. {
  30. }
  31. public static function compute($form)
  32. {
  33. foreach ($form->group_order_goods as $item) {
  34. $store_id = $item['mch_order_info']['store_id'];
  35. $mall_id = $item['mch_order_info']['mall_id'];
  36. $order_check = GlobalInvoke::exec(GlobalInvoke::ORDERC_CHECK, $mall_id, ['mall_id' => $mall_id,'pay_money' => $item['mch_order_info']['total_pay_price'],'store_id' => $store_id]);
  37. if($order_check && $order_check['status'] === false){
  38. //下单检测失败
  39. $msg = $order_check['msg'] ?? '下单检测失败';
  40. throw new Exception($msg);
  41. }
  42. }
  43. }
  44. }