afa 7 ماه پیش
والد
کامیت
eebba3668b
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 4 0
      application/api/controller/Market.php
  2. 1 1
      application/common/model/ProductOrder.php

+ 4 - 0
application/api/controller/Market.php

@@ -163,9 +163,13 @@ class Market extends Api
             // 扣除冻结金额
             $ledgerWalletModel->changeWalletOnly($buying->user_id, Asset::BUYING, -$buying->min_price); //解冻金额
 
+            //添加订单
+            $productOrder::setCreateOrder($params['order_id'], ['product_id' => $buying->product_id, 'area_id' => 0,'price' => $buying->min_price], ProductOrder::Buying, $this->auth->id, $buying->user_id, getOrderSN('R'), 0, $buying->min_price);
+
             //关闭订单
             $productOrder::where('id', $params['order_id'])->where('user_id', $this->auth->id)->setField(['status' => ProductOrder::Closure]);
 
+
             if(($buying->stock - $buying->num) == 1) $buying->status = ProductBuying::SaleOut;
             $buying->num += 1;
             $buying->save();

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

@@ -42,7 +42,7 @@ class ProductOrder extends Model
     const Super             = 4; //新人福利空投
     const Airdrop           = 5; //空投
     const Synthesi          = 6; //合成
-
+    const Buying            = 7; //求购
     
     // 订单状态 '已下单', 1=>'已付款', 2=>'已转让', 3=>'提货', 4=>'已取消', 5=>'完成'];