wesmiler 5 часов назад
Родитель
Сommit
0b9de3c1be
2 измененных файлов с 12 добавлено и 1 удалено
  1. 10 0
      app/Models/AccountLogModel.php
  2. 2 1
      app/Services/Api/AccountService.php

+ 10 - 0
app/Models/AccountLogModel.php

@@ -31,4 +31,14 @@ class AccountLogModel extends BaseModel
         return $this->hasOne(MemberModel::class, 'id','user_id')
             ->select(['id','mobile','nickname','status']);
     }
+
+    /**
+     * 提现记录
+     * @return \Illuminate\Database\Eloquent\Relations\HasOne
+     */
+    public function withdraw()
+    {
+        return $this->hasOne(BalanceLogModel::class, 'order_no','source_order_no')
+            ->where(['mark'=>1]);
+    }
 }

+ 2 - 1
app/Services/Api/AccountService.php

@@ -192,7 +192,8 @@ class AccountService extends BaseService
             $where['a.type'] = $type;
         }
 
-      return $this->model->with(['member'])->from("account_logs as a")
+      return $this->model->with(['member','withdraw'])
+            ->from("account_logs as a")
             ->leftJoin('member as b','b.id','=','a.user_id')
             ->where($where)
             ->where(function ($query) use($params) {