123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php
- namespace app\mobile\controller;
- use app\mobile\EmpBaseController;
- use app\common\model\WorkerLog as WorkerLogModel;
- use app\common\model\ResumeInvite as ResumeInviteModel;
- use app\common\model\Comjobs as ComjobsModel;
- use app\common\model\ComjobsLog as ComjobsLogModel;
- class Emp extends EmpBaseController
- {
- public function index()
- {
- $workerid = $this->worker->id;
- $countobj = [];
- $countobj['yesterday'] = WorkerLogModel::where('workerid', '=', $workerid)->whereDay('createtime', 'yesterday')->sum('ltotal');
- $countobj['today'] = WorkerLogModel::where('workerid', '=', $workerid)->whereDay('createtime')->sum('ltotal');
- $countobj['total'] = WorkerLogModel::where('workerid', '=', $workerid)->group('userid')->count();
- return view('emp/index', [
- 'worker' => $this->worker,
- 'countobj' => json_encode($countobj),
- ]);
- }
- /**
- * 个人信息
- */
- public function info()
- {
- return view('emp/info', [
- 'worker' => $this->worker->visible(['tilpic', 'title', 'realname', 'mobile', 'address', 'details']),
- ]);
- }
- public function infoPost()
- {
- $form = input('param.');
- foreach ($form as $k => $v) {
- $this->worker->$k = $v;
- }
- $this->worker->save();
- page_result(0, '操作成功');
- }
- /**
- * 我的邀请
- */
- public function invite()
- {
- return view('emp/invite', [
- 'status' => $this->request->get('status', 0),
- ]);
- }
- public function listInvite()
- {
- $page = input('page/d', 1);
- $size = input('size/d', 20);
- $status = input('status/d', 0);
- $map = [];
- $workerid = $this->worker->id;
- $map[] = ['workerid', '=', $workerid];
- if (!empty($status)) {
- $map[] = ['status', '=', $status];
- }
- $list = ResumeInviteModel::with(['user'])
- ->where($map)
- ->page($page)
- ->limit($size)
- ->append(['status_text'])
- ->select();
- page_result(0, "", $list);
- }
- /**
- * 岗位报名
- */
- public function apply()
- {
- $comjobs = ComjobsModel::field(['title as text', 'id as value'])->where('workerid', $this->worker->id)->where('status', '>', 2)->select()->toArray();
- array_unshift($comjobs, ['text' => '全部岗位', 'value' => 0]);
- return view('emp/apply', [
- 'comjobs' => json_encode($comjobs),
- 'status' => $this->request->get('status', 0),
- 'comjobsid' => $this->request->get('comjobsid', 0),
- ]);
- }
- public function listApply()
- {
- $page = input('page/d', 1);
- $size = input('size/d', 20);
- $map = [];
- $workerid = $this->worker->id;
- $map[] = ['workerid', '=', $workerid];
- $status = input('status/d', 0);
- if (!empty($status)) {
- $map[] = ['status', '=', $status];
- }
- $comjobsid = input('comjobsid/d', 0);
- if (!empty($comjobsid)) {
- $map[] = ['comjobsid', '=', $comjobsid];
- }
- $list = ComjobsLogModel::with(['comjobs', 'user'])
- ->where($map)
- ->page($page)
- ->limit($size)
- ->order(['createtime' => 'desc', 'id' => 'desc'])
- ->append(['status_text'])
- ->select();
- page_result(0, "", $list);
- }
- public function delApply()
- {
- $workerid = $this->worker->id;
- $logid = input('id/d', 0);
- $comjobslog = ComjobsLogModel::where(['workerid' => $workerid])->findOrEmpty($logid);
- if ($comjobslog->isEmpty()) {
- page_result(1, "报名记录信息不存在。");
- }
- $comjobslog->delete();
- page_result(0, "");
- }
- public function statusApply()
- {
- $logid = input('id/d', 0);
- $workerid = $this->worker->id;
- $comjobslog = ComjobsLogModel::where(['workerid' => $workerid])->findOrEmpty($logid);
- if ($comjobslog->isEmpty()) {
- page_result(1, "报名记录信息不存在。");
- }
- $status = input('status/d', 1);
- $comjobslog->save(['status' => $status]);
- page_result(0, "");
- }
- }
|