完成订单重构
This commit is contained in:
parent
d06f998573
commit
12fd8dd404
|
|
@ -70,7 +70,7 @@ class Dispatch2 extends Backend
|
|||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
$list = $this->model
|
||||
->with(['orderb'])
|
||||
->with(['orderb','lastRecord'])
|
||||
->auth($this->auth)
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
|
|
|
|||
|
|
@ -189,4 +189,9 @@ class OrderDispatch extends Model
|
|||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function lastRecord(){
|
||||
return $this->hasOne(OrderDispatchRecord::class,'dispatch_id','id')->order('id','desc')->limit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
|||
|
||||
{field: 'record_count', title: '跟进次数',operate: false},
|
||||
|
||||
{field: 'work_progress', title: '跟进内容',operate: false,formatter:function(value,row)
|
||||
{
|
||||
if(row.type == 2){
|
||||
return value;
|
||||
}else{
|
||||
if (row.last_record?.remark !== undefined) {
|
||||
return row.last_record.remark;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//{field: 'order_id', title: __('Order_id')},
|
||||
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"10":__('Status 10'),"20":__('Status 20'),"25":__('Status 25'),"30":__('Status 30'),"60":__('Status 60'),"-10":__('Status -10'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user