['store_id', 'user_id'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function lists(): array { $query = AccountsReceivable::where($this->searchWhere); if (!empty($this->params['order_sn'])) { $orderIds = BeforehandOrder::where('order_id', 'like', '%' . $this->params['order_sn'] . '%')->column('id'); $query->whereIn('order_id', $orderIds); } return $query ->with('info') ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取数量 * @return int */ public function count(): int { $query = AccountsReceivable::where($this->searchWhere); if (!empty($this->params['order_sn'])) { $orderIds = BeforehandOrder::where('order_id', 'like', '%' . $this->params['order_sn'] . '%')->column('id'); $query->whereIn('order_id', $orderIds); } return $query->count(); } }