Devin пре 1 месец
родитељ
комит
d43d3b2033
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 3 0
      application/api/controller/Demand.php
  2. 1 1
      application/api/controller/Profile.php

+ 3 - 0
application/api/controller/Demand.php

@@ -96,6 +96,9 @@ class Demand extends Api
             if ($opType == 'my') {
                 $where['user_id'] = $user_id;
                 unset($where['publish_status']);
+            } elseif ($opType == 'myQuote') {
+                $demand_ids = DemandBiddingService::where(['user_id' => $user_id])->column('demand_id');
+                $where['id'] = ['in', $demand_ids];
             }
             if ($keywords) {
                 $where['desc'] = ['like', "%$keywords%"];

+ 1 - 1
application/api/controller/Profile.php

@@ -42,7 +42,7 @@ class Profile extends Api
             'role' => $userInfo['role'],
         ];
         $publishCount = DemandService::where('user_id', $userInfo['id'])->count();
-        $quoteCount = DemandBiddingService::where(['user_id' => $userInfo['id'], 'bidding_status' => DemandBiddingService::STATUS_BIDDING_WIN])->count();
+        $quoteCount = DemandBiddingService::where(['user_id' => $userInfo['id']])->count();
         $balance = AccountService::where('user_id', $userInfo['id'])->field(['user_id', 'amount', 'freeze', '(amount + freeze) AS total_amount'])->find();
         $countsData = [
             ['num' => $publishCount, 'name' => '我发布的需求', 'type' => 'publish'],