|
@@ -146,11 +146,14 @@ class UserGroupController extends CatchController
|
|
'remark' => 'nullable|string|max:140'
|
|
'remark' => 'nullable|string|max:140'
|
|
]);
|
|
]);
|
|
|
|
|
|
- $model = UserGroupModel::create([
|
|
|
|
|
|
+ $data = [
|
|
'name' => $request->input('name'), 'uid' => $this->getLoginUserId(),
|
|
'name' => $request->input('name'), 'uid' => $this->getLoginUserId(),
|
|
'tags' => \json_encode($request->input('tags', []), JSON_UNESCAPED_UNICODE),
|
|
'tags' => \json_encode($request->input('tags', []), JSON_UNESCAPED_UNICODE),
|
|
- 'remark' => $request->input('remark', '')
|
|
|
|
- ]);
|
|
|
|
|
|
+ ];
|
|
|
|
+ if($request->input('remark')) {
|
|
|
|
+ $data['remark'] = $request->integer('remark');
|
|
|
|
+ }
|
|
|
|
+ $model = UserGroupModel::create($data);
|
|
foreach ($request->input('gzh_ids') as $gzh_id) {
|
|
foreach ($request->input('gzh_ids') as $gzh_id) {
|
|
GzhUgMapModel::create([
|
|
GzhUgMapModel::create([
|
|
'ug_id' => $model->id, 'gzh_id' => $gzh_id
|
|
'ug_id' => $model->id, 'gzh_id' => $gzh_id
|