| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace app\controller\merchant\system\notice;
- use app\common\repositories\system\notice\SystemNoticeLogRepository;
- use ln\basic\BaseController;
- use think\App;
- /**
- * Class SystemNotice
- * @package app\controller\merchant\system\notice
- * @author zfy
- * @day 2020/11/6
- */
- class SystemNoticeLog extends BaseController
- {
- /**
- * @var SystemNoticeLogRepository
- */
- protected $repository;
- /**
- * SystemNoticeLog constructor.
- * @param App $app
- * @param SystemNoticeLogRepository $repository
- */
- public function __construct(App $app, SystemNoticeLogRepository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- }
- /**
- * @return \think\response\Json
- * @author zfy
- * @day 2020/11/6
- */
- public function lst()
- {
- [$page, $limit] = $this->getPage();
- $where = $this->request->params(['is_read', 'date', 'keyword']);
- $where['mer_id'] = $this->request->merId();
- return app('json')->success($this->repository->getList($where, $page, $limit));
- }
- /**
- * @param $id
- * @author zfy
- * @day 2020/11/6
- */
- public function read($id)
- {
- $this->repository->read(intval($id), $this->request->merId());
- return app('json')->success();
- }
- public function del($id)
- {
- $this->repository->del(intval($id), $this->request->merId());
- return app('json')->success();
- }
- public function unreadCount()
- {
- return app('json')->success(['count' => $this->repository->unreadCount($this->request->merId())]);
- }
- }
|