hrjy 3 年之前
父节点
当前提交
f499c78822

+ 15 - 3
.idea/workspace.xml

@@ -6,7 +6,7 @@
   <component name="ChangeListManager">
     <list default="true" id="9df7b838-09db-466a-bed4-3e1ac8c3624d" name="变更" comment="commit">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/app/admin/controller/user/UserAuth.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/user/UserAuth.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/auction/AuctionProductController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/auction/AuctionProductController.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/app/api/controller/user/UserController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/user/UserController.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -148,7 +148,12 @@
       <workItem from="1657758526690" duration="2228000" />
       <workItem from="1657845400841" duration="2898000" />
       <workItem from="1657931803924" duration="1186000" />
-      <workItem from="1658104473401" duration="5332000" />
+      <workItem from="1658104473401" duration="11336000" />
+      <workItem from="1658190655162" duration="4128000" />
+      <workItem from="1658277507642" duration="1175000" />
+      <workItem from="1658363562193" duration="1213000" />
+      <workItem from="1658381357747" duration="2624000" />
+      <workItem from="1658709259583" duration="1236000" />
     </task>
     <task id="LOCAL-00001" summary="commit">
       <created>1655962607195</created>
@@ -234,7 +239,14 @@
       <option name="project" value="LOCAL" />
       <updated>1657703426015</updated>
     </task>
-    <option name="localTasksCounter" value="13" />
+    <task id="LOCAL-00013" summary="commit">
+      <created>1658126482385</created>
+      <option name="number" value="00013" />
+      <option name="presentableId" value="LOCAL-00013" />
+      <option name="project" value="LOCAL" />
+      <updated>1658126482385</updated>
+    </task>
+    <option name="localTasksCounter" value="14" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">

+ 2 - 2
app/api/controller/auction/AuctionProductController.php

@@ -391,7 +391,7 @@ class AuctionProductController
 
             $product->save();
             $user->save();
-            AuctionOrder::where([['uid', '=', $request->uid()], ['product_id', '=', $product['id']], ['is_gs', '=', 0]])->update(['is_gs' => 1]);// 修改订单挂售
+            AuctionOrder::where([['uid', '=', $request->uid()], ['product_id', '=', $product['id']], ['is_gs', '=', 0]])->update(['is_gs' => 1, 'gs_price' => $datas['hanging_price']]);// 修改订单挂售
             UserBill::expend('挂售扣除广告值', $user['uid'], 'anticipate', 'gs_anticipate', $datas['anticipate'], $user['spread_uid'], $user['anticipate'], '挂售商品'.$product['id'].'扣除广告值');
             UserBill::income('赠送趣豆', $user['uid'], 'integral', 'gs_integral', $datas['give'], $user['spread_uid'], $user['integral'], '挂售赠送趣豆');
 
@@ -399,7 +399,7 @@ class AuctionProductController
             return app('json')->successful('挂售成功');
         } catch (\Exception $e) {
             Db::rollback();
-            return app('json')->fail('挂售失败');
+            return app('json')->fail($e->getMessage());
         }
 
 

+ 19 - 17
app/api/controller/user/UserController.php

@@ -58,6 +58,9 @@ class UserController
         $info['commissionCount'] = bcsub($info['brokerage_price'], $info['broken_commission'], 2);
         if ($info['commissionCount'] < 0)
             $info['commissionCount'] = 0;
+//        $buy = AuctionOrder::where([['status', '=', 3], ['uid', '=', $request->uid()]])->sum('price');// 购买商品总额
+//        $sell = AuctionOrder::where([['status', '=', 3], ['collection_id', '=', $request->uid()]])->sum('price');// 出售商品总额
+        $sell = UserBill::where('uid', $info['uid'])->where('type', 'gs_integral')->sum('number');
         $level = UserLevel::where('id', $info['level'])->find();
         $info['level_name'] = $level['name']? $level['name'] : '会员';
         $info['profit'] = $this->profit($info['uid']);
@@ -72,13 +75,12 @@ class UserController
         $order = AuctionOrder::alias('a')
             ->field('a.*,b.rise,b.deduct')
             ->leftJoin('auction_product b', 'a.product_id = b.id')
-            ->where('status', 3)
             ->where('a.uid', $uid)
             ->select();
         $profit = 0;
         if (count($order) > 0){
             foreach ($order as $item) {
-                $profit += ($item['price'] * $item['rise']/100) - ($item['price'] * $item['deduct']/100);
+                $profit += ($item['price'] - $item['gs_price']) * ($item['deduct']/$item['rise']);
             }
         }
         return $profit;
@@ -113,21 +115,21 @@ class UserController
         return app('json')->fail('上传失败');
 
     }
-	/**
-	 * 实名信息查询
-	 * @param Request $request
-	 * @return mixed
-	 */
-	 public function rate(Request $request){
-		 $model=new User;
-		 $res=$model->where('uid',$request->uid())->find();
-		  $data=[
-			'is_auth'=>$res['is_auth'],
-			 'off'=>$res['off']
-
-		  ];
-		 return app('json')->success($data);
-	 }
+    /**
+     * 实名信息查询
+     * @param Request $request
+     * @return mixed
+     */
+    public function rate(Request $request){
+        $model=new User;
+        $res=$model->where('uid',$request->uid())->find();
+        $data=[
+            'is_auth'=>$res['is_auth'],
+            'off'=>$res['off']
+
+        ];
+        return app('json')->success($data);
+    }
 
     /**
      * 用户资金统计