|
|
@@ -64,23 +64,29 @@ class AccountLogService extends BaseService
|
|
|
return $datas;
|
|
|
}
|
|
|
|
|
|
- $where = ['user_id'=> $userId,'status'=>1,'mark'=>1];
|
|
|
+ $where = ['a.user_id'=> $userId,'a.status'=>1,'a.mark'=>1];
|
|
|
if($type){
|
|
|
- $where['type'] = $type;
|
|
|
+ $where['a.type'] = $type;
|
|
|
}
|
|
|
|
|
|
- $list = $this->model->with(['order','porder'])->where($where)
|
|
|
+ $list = $this->model->from('account_log as a')
|
|
|
+ ->where($where)
|
|
|
+ ->leftJoin('balance_logs as b',function($join) {
|
|
|
+ $join->on('b.order_no','=','a.order_no')->on('b.user_id','=','a.user_id');
|
|
|
+ })
|
|
|
+ ->leftJoin('pledge_orders as c',function($join) {
|
|
|
+ $join->on('c.order_no','=','a.order_no')->on('c.user_id','=','a.user_id');
|
|
|
+ })
|
|
|
->where(function($query) use($coinType){
|
|
|
if($coinType == 3){
|
|
|
- $query->whereIn('coin_type',[2,3]);
|
|
|
+ $query->whereIn('a.coin_type',[2,3]);
|
|
|
}else if($coinType>0){
|
|
|
- $query->where('coin_type', $coinType);
|
|
|
+ $query->where('a.coin_type', $coinType);
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
- ->select(['user_id','type','order_no','source_uid','money','coin_type','before_money','create_time','remark','status'])
|
|
|
- ->orderBy('create_time','desc')
|
|
|
- ->orderBy('id','desc')
|
|
|
+ ->select(['a.user_id','a.type','a.order_no','a.source_uid','a.money','a.coin_type','a.before_money','a.create_time','a.remark','a.status','b.status as b_status','b.audit_remark','b.pay_status','b.pay_at','c.status as c_status','c.expired_at','c.settle_at'])
|
|
|
+ ->orderBy('a.create_time','desc')
|
|
|
+ ->orderBy('a.id','desc')
|
|
|
->paginate($pageSize > 0 ? $pageSize : 9999999);
|
|
|
|
|
|
$list = $list ? $list->toArray() : [];
|
|
|
@@ -97,12 +103,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;
|
|
|
- }
|
|
|
+// $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 = [
|