|
@@ -49,15 +49,21 @@ class MessageRuleRepository
|
|
|
*/
|
|
|
public function create($request)
|
|
|
{
|
|
|
- return 2223;
|
|
|
- //验证小号
|
|
|
- $userInfo = $this->getUserInfo($request['uid']);
|
|
|
- if(!$userInfo || $userInfo['type'] != 1){
|
|
|
- return Response::create([
|
|
|
- 'message' => '所选小号信息有误',
|
|
|
- 'status_code' => 500
|
|
|
- ]);
|
|
|
+ $noticeGroups = explode(',', $request['notice_groups']);
|
|
|
+
|
|
|
+ if(in_array(0, $noticeGroups)){
|
|
|
+ $noticeGroups = 0;
|
|
|
+ } else {
|
|
|
+ if(array_diff($noticeGroups, [1,2])){
|
|
|
+ return Response::create([
|
|
|
+ 'message' => '通知群体参数有误',
|
|
|
+ 'status_code' => 500
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ $noticeGroups = implode(',', array_unique($noticeGroups));
|
|
|
}
|
|
|
+
|
|
|
+ return $noticeGroups;
|
|
|
//验证话题
|
|
|
$topicIds = $this->topic->whereIn('id', explode(',', $request['topic_ids']))->pluck('id')->toArray();
|
|
|
$topicCount = count($topicIds);
|