fetch(); } /* * 获取列表 * @param int page * @param int limit * */ public function get_job_list() { $where = UtilService::getMore([ ['page', 1], ['limit', 20], ['is_show', -1] ]); return app('JobLogic')->getPageList($where); } public static function isShow($id) { return app('JobLogic')->toggleIsShow($id); } public function create() { return $this->fetch(); } public function add_job() { $data = Util::postMore([ 'job_name', 'is_show', 'rank' ]); return app('JobLogic')->add($data); } public function isDel($id) { return app('JobLogic')->delById($id); } public function edit($id) { $this->assign('model', app('JobLogic')::get($id)); return $this->fetch(); } public function edit_job() { $data = Util::postMore([ 'id', 'job_name', 'is_show', 'rank', ]); if (empty($data['id'])) { return JsonService::fail('id不能为空'); } return app('JobLogic')->edit($data); } }