WIN-2308041133\Administrator hace 1 día
padre
commit
c2e32139c0

+ 4 - 1
app/dao/order/StoreOrderDao.php

@@ -1079,6 +1079,9 @@ class StoreOrderDao extends BaseDao
      */
     public function getGiftOrder(int $uid)
     {
-        return $this->getModel()->where('uid', $uid)->where('pid', 1)->where('order_type',1 )->count();
+        $a=$this->getModel()->where('uid', $uid)->where('pid', 1)->where('order_type',1 )->count();
+        $sql = $this->getModel()->getLastSql();
+        @file_put_contents("quanju.txt", $sql."礼包检查sql \r\n", 8);
+        return $a;
     }
 }

+ 2 - 0
app/services/order/StoreOrderServices.php

@@ -2824,6 +2824,8 @@ HTML;
     public function checkGift(int $uid)
     {
         $order_count = $this->dao->getGiftOrder($uid);
+        @file_put_contents("quanju.txt", $order_count."礼包检查: \r\n", 8);
+
         if ($order_count > 0) {
             return false;
         } else {

+ 2 - 0
app/services/order/StoreOrderSuccessServices.php

@@ -114,6 +114,8 @@ class StoreOrderSuccessServices extends BaseServices
         $res = $res1 && $resPink;
         if ($orderInfo['order_type']==1){  //礼包商品订单赠送复购商品优惠卷
             $grantNum = sys_config('repeat_discount_num',0);
+            @file_put_contents("quanju.txt", json_encode(['uid'=>$orderInfo['uid'],'grantNum'=>$grantNum])."-礼包订单赠送复购折扣次数\r\n", 8);
+
             if ($grantNum > 0){
                 /** @var UserServices $userServices */
                 $userServices = app()->make(UserServices::class);