| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\workerapi\controller;
- use app\workerapi\lists\MasterWorkerMessageLists;
- use app\workerapi\logic\MasterWorkerMessageLogic;
- class MasterWorkerMessageController extends BaseApiController
- {
- /**
- * 统计师傅未读消息数量
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author 林海涛
- * @date 2024/7/11 下午6:28
- */
- public function msgStatistics()
- {
- $data = MasterWorkerMessageLogic::msgStatistics($this->userId);
- return $this->success('操作成功', $data, 1, 0);
- }
- public function lists()
- {
- return $this->dataLists(new MasterWorkerMessageLists());
- }
- public function showMsg()
- {
- $validate = \think\facade\Validate::rule([
- 'ids' => 'require|array',
- 'msg_type' => 'require'
- ]);
- if (!$validate->check(request()->all())) {
- return $this->fail($validate->getError());
- }
- MasterWorkerMessageLogic::showMsg(request()->all(),$this->userId);
- return $this->success('操作成功', [], 1, 0);
- }
- }
|