title = '系统接口列表'; $this->system_id = input('system_id'); $query = $this->_query($this->table); $this->config = SystemService::instance()->getConfig(); $query->equal('status')->dateBetween('create_at'); $query->like('name'); $query->order('status desc, id desc')->page(); } /** * 数据列表处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function _page_filter(&$data) { $this->service = ProductBaseService::instance()->getServiceAll(); foreach ($data as &$vo) { //$vo['channel_name'] = $this->app->db->name('ChannelList')->where(['id' => $vo['cid']])->value('name'); } } /** * 添加系统接口 * @auth true * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function add() { $this->_applyFormToken(); $this->_form($this->table, 'form'); } /** * 编辑系统接口 * @auth true * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function edit() { $this->_applyFormToken(); $this->_form($this->table, 'form'); } /** * 表单数据处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function _form_filter(&$data) { $this->system_id = input('system_id'); $this->service = ProductBaseService::instance()->getServiceAll(); $this->config = SystemService::instance()->getConfig(); } protected function _form_result($id, $data) { //ChannelService::instance()->get($id, false); } /** * 修改系统接口状态 * @auth true * @throws \think\db\exception\DbException */ public function state() { $this->_applyFormToken(); $this->_save($this->table, $this->_vali([ 'status.in:0,1' => '状态值范围异常!', 'status.require' => '状态值不能为空!', ])); } /** * 删除系统接口 * @auth true * @throws \think\db\exception\DbException */ public function remove() { $this->_applyFormToken(); $this->_delete($this->table); } }