hrjy 2 yıl önce
ebeveyn
işleme
e28b1367fd

+ 1 - 1
app/api/controller/user/UserController.php

@@ -63,7 +63,7 @@ class UserController
         $level = UserLevel::where('id', $info['level'])->find();
         $level = UserLevel::where('id', $info['level'])->find();
         $info['level_name'] = $level['name']? $level['name'] : '会员';
         $info['level_name'] = $level['name']? $level['name'] : '会员';
         if ($sell){
         if ($sell){
-            $info['profit'] = bcsub($sell, $buy, 2)  <= 0? 0 :  bcsub($sell, $buy, 2); // 收益
+            $info['profit'] = (bcmul($sell, 0.005, 2)+bcmul($sell, 0.005, 2));
         }else{
         }else{
             $info['profit'] = 0; // 收益
             $info['profit'] = 0; // 收益
         }
         }

+ 4 - 1
app/models/auction/AuctionProduct.php

@@ -112,7 +112,10 @@ class AuctionProduct extends BaseModel
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
      */
      */
     public static function user_product($data, $uid){
     public static function user_product($data, $uid){
-        $model = self::where('uid', $uid)->order('id DESC');
+        $model = self::alias('a')
+            ->field('a.*,b.nickname')
+            ->leftJoin('auction b', 'a.auction_id = b.id')
+            ->where('a.uid', $uid)->order('a.id DESC');
         $model->page($data['page'], $data['limit']);
         $model->page($data['page'], $data['limit']);
 
 
         $list = $model->select();
         $list = $model->select();