afa 7 сар өмнө
parent
commit
329f661dac

+ 3 - 5
application/api/controller/Synthesis.php

@@ -83,15 +83,13 @@ class Synthesis extends Api
 
         Db::startTrans();
         try {
-            
+          
             // 合成订单
             $productOrder->setSynthesisOrder($synthesis, $productList, $num, $this->auth->id);
 
             // 添加新订单
-            $result = WelfareLoginc::setUserWelfareLos($this->auth->id, $synthesis->product_id, $num, time(), $this->lan, $productOrder::Synthesi);
-
-            //添加茶数量
-            if($result['price'] > config('min_rwa_price')) $userModel::updateForRwaNum($this->auth->id, $this->auth->parent_id, $num, '+');
+            //$result = WelfareLoginc::setUserWelfareLos($this->auth->id, $synthesis->product_id, $num, time(), $this->lan, $productOrder::Synthesi);
+            WelfareLoginc::setUserProductOrder($num, 0, $synthesis->id, 0, $synthesis->product_id, $this->auth->id, $productOrder::Synthesi);
 
             $synthesis->num += $num;
             $synthesis->save();

+ 1 - 1
application/api/logic/WelfareLoginc.php

@@ -37,7 +37,7 @@ class WelfareLoginc
         $result = ProductPopular::getPopularByTime($productId, $lan, $tim);
 
         if(!$result || $num > ($result->stock-$result->init_num - $result->num)) throw new Exception(__('库存不足'));
-        
+        //echo 111;die;
         //添加产品
         self::setUserProductOrder($num, $result->is_area, $result->id, $result->price, $productId, $uid, $typeId);
         return ['start_time'=>$tim, 'name'=>$result->name, 'num'=>$num, 'price'=>$result->price];

+ 1 - 1
application/common/model/ProductOrder.php

@@ -142,7 +142,7 @@ class ProductOrder extends Model
         }
         return $productId;
     }
-       
+
     //获取持有产品数量
     private static function getUserOrderNum(int $uid, int $product_id): int
     {

+ 0 - 1
application/common/model/ProductPopular.php

@@ -99,7 +99,6 @@ class ProductPopular extends Model
            ->where('a.product_id', $productId)->find();
     }
 
- 
     //分类
     public function productsList()
     {