|
@@ -32,4 +32,34 @@ class Issue extends Controller
|
|
|
}
|
|
|
return $this->success($result);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 修改|新增
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public function store()
|
|
|
+ {
|
|
|
+ // try {
|
|
|
+ $params = request()->all();
|
|
|
+
|
|
|
+ $validator = [
|
|
|
+ 'issue_no' => 'required|string|max:50|alpha_dash|unique:issues,issue_no',
|
|
|
+ 'winning_numbers' => 'nullable|string|max:100',
|
|
|
+ 'status' => 'nullable|string',
|
|
|
+ ];
|
|
|
+
|
|
|
+ request()->validate($validator);
|
|
|
+
|
|
|
+ $ret = IssueService::submit($params);
|
|
|
+ if ($ret['code'] == IssueService::NOT) {
|
|
|
+ return $this->error($ret['code'], $ret['msg']);
|
|
|
+ }
|
|
|
+ // } catch (ValidationException $e) {
|
|
|
+ // return $this->error(HttpStatus::VALIDATION_FAILED, '', $e->errors());
|
|
|
+ // } catch (Exception $e) {
|
|
|
+ // return $this->error(intval($e->getCode()));
|
|
|
+ // }
|
|
|
+ return $this->success([], $ret['msg']);
|
|
|
+
|
|
|
+ }
|
|
|
}
|