Browse Source

订单关联

afa 11 months ago
parent
commit
a486554ec4
2 changed files with 4 additions and 4 deletions
  1. 2 2
      application/api/controller/Order.php
  2. 2 2
      application/api/controller/User.php

+ 2 - 2
application/api/controller/Order.php

@@ -18,7 +18,7 @@ use think\Db;
 use think\Env;
 
 /**
- * 服务器相关接口
+ * 订单关联
  */
 class Order extends Api
 {
@@ -57,7 +57,7 @@ class Order extends Api
 
             //余额记录
             UserBalanceLog::changeWalletAccount($this->auth->id, UserBalanceLog::Popular, $order_info['price'], 
-            $this->auth->balance, bcsub($this->auth->balance, $order_info['price'], 6), $order->id);
+            $this->auth->balance, bcsub($this->auth->balance, $order_info['price'], 6), $order->id, '-');
             //扣除库存
             if($order_info->stock == 1 || time() >= $order_info->end_time) $order_info->status= $productPopular::STOP;
             $order_info->num  += 1;

+ 2 - 2
application/api/controller/User.php

@@ -78,10 +78,10 @@ class User extends Api
               ->join("product_list b", "b.id = a.product_id", "left")
               ->join("products c", "c.id = b.type_id", "left")
               ->field('a.id as order_id,a.product_id,'.'b.'.$this->lan.'_name,b.images as img_url,a.price,a.status,a.type_id,c.'.$this->lan.'_title')
-              ->where('a.user_id', $this->auth->id)
+              ->where('a.user_id', 1008)
               ->order('a.id DESC')
               ->paginate($this->pageSize);
-
+     
         $this->success('', $list);
     }