| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 小夏 < 449134904@qq.com>
- // +----------------------------------------------------------------------
- namespace app\talent\controller;
- use app\admin\model\UserModel;
- use app\talent\model\TalentAppointmentLogModel;
- use app\talent\model\TalentAppointmentModel;
- use app\talent\model\TalentModel;
- use cmf\controller\AdminBaseController;
- class AdminAppointmentController extends AdminBaseController
- {
- public function index()
- {
- $param = $this->request->param();
- //搜索条件
- $where = [];
- if (!empty($param['name'])) {
- $where[] = ['cmf_talent_appointment.name', 'like', "%{$param['name']}%"];
- }
- if (!empty($param['mobile'])) {
- $where[] = ['cmf_talent_appointment.mobile', '=', $param['mobile']];
- }
- if (!empty($param['shift'])) {
- $where[] = ['shift', 'like', "%{$param['shift']}%"];
- }
- $list = TalentAppointmentModel::alias('ta')
- ->join('cmf_talent t', 'ta.talent_id = t.id')
- ->field(['ta.*','t.name','t.mobile'])
- ->where($where)
- ->append(['status_text'])
- ->paginate(10, false, ['query' => $param]);
- $this->assign('name', isset($param['name']) ? $param['name'] : '');
- $this->assign('mobile', isset($param['mobile']) ? $param['mobile'] : '');
- $this->assign('shift', isset($param['shift']) ? $param['shift'] : '');
- $this->assign('list', $list->items());
- $this->assign('page', $list->render());
- return $this->fetch();
- }
- public function edit()
- {
- $id = $this->request->param('id', 0, 'intval');
- $info = TalentModel::get($id);
- $this->assign('info', $info);
- return $this->fetch();
- }
- public function editPost()
- {
- if ($this->request->isPost()) {
- $data = $this->request->post();
- TalentModel::update($data, ['id' => $data['id']]);
- $this->success('编辑成功!', url('index'));
- }
- }
- public function log()
- {
- $param = $this->request->param();
- $list = TalentAppointmentLogModel::order('create_time desc')->paginate(10, false, ['query' => $param]);
- $this->assign('list', $list->items());
- $this->assign('page', $list->render());
- return $this->fetch();
- }
- }
|