title = '电影列表'; $query = $this->_query($this->table)->like('name'); $query->order('status asc,sort desc,id desc')->page(); } /** * @auth true * @menu true * 电影上架 */ public function up() { $this->_save($this->table, ['status' => '1']); } /** * @auth true * @menu true * 电影下架 */ public function down() { $this->_save($this->table, ['status' => '2']); } /** * @auth true * @menu true * 添加电影 * @auth true * @menu true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function add() { $this->title = '添加电影'; $this->_form($this->table, 'form'); } /** * 编辑电影 * @auth true * @menu true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function edit() { $this->title = '编辑电影'; $this->_form($this->table, 'form'); } }