shish 6 лет назад
Родитель
Сommit
cc02ea8def
1 измененных файлов с 19 добавлено и 1 удалено
  1. 19 1
      app/business/controllers/MerchantRemarkController.php

+ 19 - 1
app/business/controllers/MerchantRemarkController.php

@@ -3,12 +3,13 @@
 namespace business\controllers;
 
 use biz\merchant\services\MerchantRemarkService;
+use biz\user\services\UserService;
 use common\components\util;
 use Yii;
 
 class MerchantRemarkController extends BaseController
 {
-
+	
 	//删除备注
 	public function actionDelete()
 	{
@@ -19,4 +20,21 @@ class MerchantRemarkController extends BaseController
 		util::ok('删除成功');
 	}
 
+	//添加备注 shish 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('请填写备注');
+		}
+		$user = UserService::getById($userId);
+		UserService::valid($user, $this->merchantId);
+		$post['addTime'] = time();
+		$post['merchantId'] = $this->merchantId;
+		MerchantRemarkService::add($post);
+		util::ok('添加成功');
+	}
+
 }