wugg 2 years ago
parent
commit
9360b006a6
2 changed files with 5 additions and 4 deletions
  1. 4 3
      app/command/handleYzOrderData.php
  2. 1 1
      app/txx/controller/Good.php

+ 4 - 3
app/command/handleYzOrderData.php

@@ -186,16 +186,17 @@ class handleYzOrderData extends Command
 //                        return $query->where('ga.start', '<=', date('Y-m-d H:i:s'))->where('ga.end', '>=', date('Y-m-d H:i:s'));
 //                    })
 //                    ->find();
-
+				$is_activity = 0;
                 $sale_price = $c_data['discount_price'];
 	            if (isset($c_data['coupon']) && is_discount($c_data['coupon'])) {
 		            //如果是泰行销的单子,要取原始价格(即优惠前的价格)
+		            $is_activity=2;//txx活动标识
 		            $sale_price = $c_data['price'];
 	            }
 
 
                 $act = check_activity((string)$spuCode, (string)$skuCode, (int)$platform_id, (int)$is_stock, (float)$sale_price, (int)$good_num);
-                $is_activity = 0;
+
                 if (!empty($act)) {
                     $is_activity = 1;
                     $sale_price = $act['final_price'];//取活动的相关价格
@@ -298,7 +299,7 @@ class handleYzOrderData extends Command
                     "remark" => $remark,
                     "is_stock" => $is_stock,
                     "is_activity" => $is_activity,
-                    'activity_code' => $is_activity ? $act['activity_code'] : '',
+                    'activity_code' => $is_activity==1 ? $act['activity_code'] : ($is_activity==2?"txx":""),
                     "order_type" => $order_type,
                     "order_source" => $order_source,
 //                "poNo"=>$poNo,

+ 1 - 1
app/txx/controller/Good.php

@@ -59,7 +59,7 @@ class Good extends BaseController
 		try{
 			$data=[];
 			foreach ($snArr as $item){
-				$isExit = $actGood->find(["actCode"=>$actCode,"yz_good_code"=>$item['skuCode'],"is_del"=>0]);
+				$isExit = $actGood->find(["actCode"=>$actCode,"yz_good_code"=>$item['skuCode'],"roundId"=>$item['roundId']??"","is_del"=>0]);
 				if($isExit) throw new Exception("活动商品已添加",1006);
 				$temp=[
 					"actCode"=>$actCode,