|
@@ -58,18 +58,18 @@ class Repair extends Controller
|
|
|
if(isset($data['status']) && $data['status'] != ""){
|
|
|
$where['status'] = $data['status'];
|
|
|
}
|
|
|
+ if($name != ""){
|
|
|
+ $where[] = ['u.nickname','like','%'.$name.'%'];
|
|
|
+ }
|
|
|
$result = DataUserRepair::mQuery()
|
|
|
- ->when($name,function (Query $query) use ($name) {
|
|
|
- $query->hasWhere('user',function (Query $query) use ($name) {
|
|
|
- $query->whereLike('nickname',"%{$name}%");
|
|
|
- });
|
|
|
- })
|
|
|
+ ->alias('r')
|
|
|
+ ->leftjoin('data_user u','u.id = r.uuid')
|
|
|
->where('is_del',1)
|
|
|
->whereLike('order_no',"%$order_no%")
|
|
|
->dateBetween('create_at')
|
|
|
->where($where)
|
|
|
->with(['user'])
|
|
|
- ->order('id','desc');
|
|
|
+ ->order('r.id','desc');
|
|
|
// ->layTable();
|
|
|
$this->amount = $result->db()->sum('success_price');
|
|
|
$result->page();
|