| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace ghs\controllers;
- use biz\sj\services\MerchantRemarkService;
- use bizHd\user\services\UserService;
- use common\components\util;
- use Yii;
- class MerchantRemarkController extends BaseController
- {
-
- //删除备注
- public function actionDelete()
- {
- $id = Yii::$app->request->get('id');
- $remark = MerchantRemarkService::getById($id);
- MerchantRemarkService::valid($remark, $this->sjId);
- MerchantRemarkService::deleteById($id);
- util::complete('删除成功');
- }
- //添加备注 ssh 2019.12.19
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- $userId = isset($post['userId']) ? $post['userId'] : 0;
- $remark = isset($post['remark']) ? $post['remark'] : '';
- if (empty($remark)) {
- util::fail('请填写备注189');
- }
- $user = UserService::getById($userId);
- UserService::valid($user, $this->sjId);
- $post['addTime'] = time();
- $post['sjId'] = $this->sjId;
- MerchantRemarkService::add($post);
- util::complete('添加成功');
- }
- }
|