wesmiler 1 ano atrás
pai
commit
7aa51a3618

+ 1 - 1
app/Http/Controllers/Api/v1/MemberController.php

@@ -92,7 +92,7 @@ class MemberController extends webApp
     {
         $params = request()->post();
         if($result = MemberService::make()->withdraw($this->userId, $params)){
-            return showJson(MemberService::make()->getError(), true, $result);
+            return showJson(2027, true, $result);
         }else{
             return showJson(MemberService::make()->getError(),false, MemberService::make()->getErrorData());
         }

+ 21 - 0
app/Models/AccountLogModel.php

@@ -34,4 +34,25 @@ class AccountLogModel extends BaseModel
             ->select(['id','nickname','usdt','wallet_url','sbt','profit','avatar','status']);
     }
 
+    /**
+     * 账单
+     * @return \Illuminate\Database\Eloquent\Relations\HasOne
+     */
+    public function order()
+    {
+        return $this->hasOne(BalanceLogModel::class, 'order_no','order_no')
+            ->where(['mark'=>1])
+            ->select(['id','pay_status','pay_at','money','actual_money','hash','fee','fee_usdt','audit_remark','status']);
+    }
+
+    /**
+     * 质押订单
+     * @return \Illuminate\Database\Eloquent\Relations\HasOne
+     */
+    public function porder()
+    {
+        return $this->hasOne(PledgeOrderModel::class, 'order_no','order_no')
+            ->where(['mark'=>1])
+            ->select(['id','money','bonus_rate','sbt_price','profit','time','round','expired_at','settle_at','status']);
+    }
 }

+ 7 - 1
app/Services/Api/AccountLogService.php

@@ -69,7 +69,7 @@ class AccountLogService extends BaseService
             $where['type'] = $type;
         }
 
-        $list = $this->model->where($where)
+        $list = $this->model->with(['order','porder'])->where($where)
             ->where(function($query) use($coinType){
                 if($coinType == 3){
                     $query->whereIn('coin_type',[2,3]);
@@ -97,6 +97,12 @@ class AccountLogService extends BaseService
                 $remark = isset($item['remark']) && $item['remark']? $item['remark'] : '交易明细';
                 $type = isset($item['type'])? $item['type'] : 0;
                 $item['type_text'] = isset($types[$type])? $types[$type] : $remark;
+                $order = isset($item['order'])? $item['order'] : [];
+                $pledgeOrder = isset($item['porder'])? $item['porder'] : [];
+                if($item['type'] == 4 &&  in_array($item['coin_type'],[1,3])){
+                    $item['status'] = isset($order['status'])? intval($order['status']) : $item['status'];
+                    $item['pay_status'] = isset($order['pay_status'])? intval($order['pay_status']) : 10;
+                }
             }
 
             $datas = [