sth
This commit is contained in:
parent
32a704d083
commit
d8a8bcfb71
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\controller\orders;
|
||||
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\Order;
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
|
@ -49,7 +50,7 @@ class Configorder extends Backend
|
|||
public function index()
|
||||
{
|
||||
//当前是否为关联查询
|
||||
$this->relationSearch = true;
|
||||
$this->relationSearch = false;
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if ($this->request->isAjax()) {
|
||||
|
|
@ -62,7 +63,7 @@ class Configorder extends Backend
|
|||
->tab(Order::TAB_SETTING)
|
||||
->auth($this->auth,'dispatch_admin_id')
|
||||
->areaauth($this->auth)
|
||||
->with(['dispatch'])
|
||||
->with(['dispatchadmin'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
|
@ -162,4 +163,15 @@ class Configorder extends Backend
|
|||
}
|
||||
|
||||
|
||||
public function getadminuser(){
|
||||
|
||||
$groupId = 6;
|
||||
|
||||
//$adminIds = Db::name('auth_group_access')->where('group_id',$groupId)->column('uid');
|
||||
//whereIn('id',$adminIds)
|
||||
$adminUsers = Admin::field(['id','nickname as name'])->select();
|
||||
|
||||
return json($adminUsers);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,11 +201,21 @@ class Order extends Model
|
|||
return $this->belongsTo(Admin::class,'audit_admin_id',);
|
||||
}
|
||||
|
||||
|
||||
public function dispatchadmin(){
|
||||
return $this->belongsTo(Admin::class,'dispatch_admin_id',);
|
||||
}
|
||||
|
||||
|
||||
public function dispatch()
|
||||
{
|
||||
return $this->hasOne(OrderDispatch::class, 'order_id', 'id', [], 'LEFT')->setEagerlyType(0)->where('fa_order_dispatch.status',OrderDispatch::STATUS_FINISH);
|
||||
}
|
||||
|
||||
public function dispatch2()
|
||||
{
|
||||
return $this->hasOne(OrderDispatch::class, 'order_id', 'id', [], 'LEFT')->setEagerlyType(1)->where('fa_order_dispatch.status',OrderDispatch::STATUS_FINISH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员权限
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
//{field: 'dispatch.worker_name', title: __('Dispatch.worker_name'), operate: 'LIKE'},
|
||||
//{field: 'dispatch.worker_tel', title: __('Dispatch.worker_tel'), operate: 'LIKE'},
|
||||
|
||||
{field: 'dispatch.admin_user', title: __('Dispatch.admin_user'), operate: '='},
|
||||
{field: 'dispatchadmin.nickname', title: __('Dispatch.admin_user'), operate: false},
|
||||
|
||||
{field: 'dispatch_admin_id', title: __('派单员'), searchList:$.getJSON("orders/configorder/getadminuser"),operate: 'IN',visible:false},
|
||||
|
||||
{field: 'status', title: __('Status'), searchList: {"40":__('Status 40'),"41":__('Status 41')}, formatter: Table.api.formatter.status},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user