12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace app\admin\controller\enterprise;
- use app\admin\controller\AuthController;
- use app\logic\JobLogic;
- use crmeb\traits\CurdControllerTrait;
- use app\admin\model\enterprise\EnterPriseUser as UserModel;
- use crmeb\services\{JsonService as Json, UtilService, JsonService, UtilService as Util};
- use think\facade\App;
- use think\facade\Db;
- /**
- * 会员设置
- * Class UserLevel
- * @package app\admin\controller\user
- */
- class Job extends AuthController
- {
- use CurdControllerTrait;
- /*
- * 职务列表
- * */
- public function index()
- {
- return $this->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);
- }
- }
|