wesmiler 3 dias atrás
pai
commit
0b9de3c1be

+ 10 - 0
app/Models/AccountLogModel.php

@@ -31,4 +31,14 @@ class AccountLogModel extends BaseModel
         return $this->hasOne(MemberModel::class, 'id','user_id')
         return $this->hasOne(MemberModel::class, 'id','user_id')
             ->select(['id','mobile','nickname','status']);
             ->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;
             $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')
             ->leftJoin('member as b','b.id','=','a.user_id')
             ->where($where)
             ->where($where)
             ->where(function ($query) use($params) {
             ->where(function ($query) use($params) {