sth
This commit is contained in:
parent
ac3e4c8ba2
commit
9f9193a2c8
|
|
@ -54,17 +54,29 @@ class Aftersale extends Backend
|
||||||
$this->relationSearch = true;
|
$this->relationSearch = true;
|
||||||
//设置过滤方法
|
//设置过滤方法
|
||||||
$this->request->filter(['strip_tags', 'trim']);
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
|
||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
|
|
||||||
|
$from = $this->request->param('from',1);
|
||||||
|
$dispatch_admin_id = $this->request->param('dispatch_admin_id');
|
||||||
|
|
||||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
if ($this->request->request('keyField')) {
|
if ($this->request->request('keyField')) {
|
||||||
return $this->selectpage();
|
return $this->selectpage();
|
||||||
}
|
}
|
||||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
$list = $this->model
|
$builder = $this->model
|
||||||
->with(['order'])
|
->with(['order'])
|
||||||
->where($where)
|
->where($where);
|
||||||
->order($sort, $order)
|
|
||||||
|
if($from == 2){
|
||||||
|
//$builder->where('refund_amount','>',0);
|
||||||
|
//$builder->where('status','<>',-1);
|
||||||
|
$builder->where('fa_aftersale.dispatch_admin_id',$dispatch_admin_id ?: 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
$list = $builder->order($sort, $order)
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
|
|
||||||
foreach ($list as $row) {
|
foreach ($list as $row) {
|
||||||
|
|
@ -148,6 +160,10 @@ class Aftersale extends Backend
|
||||||
unset($params['company_refund_amount']);
|
unset($params['company_refund_amount']);
|
||||||
unset($params['worker_refund_amount']);
|
unset($params['worker_refund_amount']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$params['dispatch_admin_id'] = $order->dispatch_admin_id;
|
||||||
|
$params['dispatch_admin_user'] = $order->dispatch_admin_user;
|
||||||
|
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
$order->aftersale_id = $this->model->id;
|
$order->aftersale_id = $this->model->id;
|
||||||
$order->save();
|
$order->save();
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t
|
||||||
visible:false,
|
visible:false,
|
||||||
defaultValue: Config.default_daterange
|
defaultValue: Config.default_daterange
|
||||||
},
|
},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table2, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'aftersales',
|
||||||
|
text:"售后列表",
|
||||||
|
title:"售后列表",
|
||||||
|
icon: 'fa fa-list',
|
||||||
|
url: function(row){
|
||||||
|
return 'aftersales/aftersale/index?from=2&dispatch_admin_id='+row.id;
|
||||||
|
},
|
||||||
|
extend: 'data-toggle="tooltip" data-container="body"',
|
||||||
|
classname: 'btn btn-xs btn-default btn-dialog',
|
||||||
|
visible:function(row){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
@ -207,6 +223,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t
|
||||||
edit: function () {
|
edit: function () {
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
aftersales: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
|
||||||
api: {
|
api: {
|
||||||
bindevent: function () {
|
bindevent: function () {
|
||||||
Form.api.bindevent($("form[role=form]"));
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user