when(!empty($this->request->adminInfo['store_id']), function ($query) { $query->where('store_id', '=', $this->request->adminInfo['store_id']); }) ->when(!empty($this->params['keyword']), function ($query) { $query->where('staff_name|account|phone', 'like', "%{$this->params['keyword']}%"); }) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取订单列表数量 * @return int * @author admin * @date 2024/05/31 16:02 */ public function count(): int { return SystemStoreStaff::when(!empty($this->request->adminInfo['store_id']), function ($query) { $query->where('store_id', '=', $this->request->adminInfo['store_id']); }) ->when(!empty($this->params['keyword']), function ($query) { $query->where('staff_name|account|phone', 'like', "%{$this->params['keyword']}%"); }) ->count(); } }