selectField = ["id", "user_id", "product_id", "status", "created_at", "updated_at", "deleted_at"]; $this->queryField = ['user_id' => '=','product_id' => '=,status=']; $this->model = UserBrowsingHistoryModel::class; } /** * 获取用户浏览记录列表 * @return array * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function list(): array { $this->with = [ 'user:id,nick_name,avatar', 'product' ]; return $this->getPageList(); } /** * 获取用户浏览记录详情 * @param $id * @return mixed * @throws Exception */ public function detail($id) { return $this->getDetail($id); } /** * 用户浏览记录下拉列表 * @return mixed */ public function option() { $this->optionField = ['id', 'name']; return $this->getOption(); } /** * 创建用户浏览记录 * @param $params * @return mixed * @throws Exception */ public function create($params): mixed { return $this->insert($params); } /** * 编辑用户浏览记录 * @param $id * @param $params * @return mixed * @throws Exception */ public function update($id, $params): mixed { return $this->save($id, $params); } /** * 删除用户浏览记录 * @param $ids * @return mixed|true * @throws Exception */ public function delete($ids): mixed { return $this->del($ids); } }