wesmiler 3 месяцев назад
Родитель
Сommit
7dc45d17cd
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      app/Models/AccountLogModel.php

+ 12 - 0
app/Models/AccountLogModel.php

@@ -44,6 +44,18 @@ class AccountLogModel extends BaseModel
         return isset($statusArr[$this->status])?$statusArr[$this->status]:'已完成';
     }
 
+    // 账单
+    public function getBillAttribute()
+    {
+        if($this->type==3){
+            return BalanceLogModel::where(['order_no'=>$this->source_order_no,'mark'=>1])
+                ->select(['id','user_id','order_no','money','pay_at','confirm_remark','transaction_id','confirm_at','create_time','status'])
+                ->first();
+        }else{
+            return [];
+        }
+    }
+
     /**
      * 用户
      * @return \Illuminate\Database\Eloquent\Relations\HasOne