12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use app\common\model\UserRemark;
- use app\common\library\Keyworld;
- use think\Db;
- /**
- *
- */
- class UserInfo extends Api
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = '*';
- // 设置备注
- public function setRemark()
- {
- $params = $this->request->param();
- $user_id = $this->auth->id;
- if (empty($params['to_user_id'])) {
- return $this->error('参数缺失');
- }
- $model = new UserRemark();
- if (!empty($params['remark'])) {
- [$res, $msg] = $model->setRemark($user_id, $params['to_user_id'], Keyworld::sensitive($params['remark']));
- } else {
- [$res, $msg] = $model->delRemark($user_id, $params['to_user_id']);
- }
- if (!$res) {
- return $this->error($msg);
- }
- return $this->success($msg);
- }
- }
|