正在显示
3 个修改的文件
包含
151 行增加
和
132 行删除
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="ChangeListManager"> | 3 | <component name="ChangeListManager"> |
4 | <list default="true" id="73de7205-e736-4b59-941a-a54ab4506a41" name="Default" comment=""> | 4 | <list default="true" id="73de7205-e736-4b59-941a-a54ab4506a41" name="Default" comment=""> |
5 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> | 5 | + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/FinanceController.php" afterPath="$PROJECT_DIR$/api/index/controller/FinanceController.php" /> |
6 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/SendController.php" afterPath="$PROJECT_DIR$/api/index/controller/SendController.php" /> | 6 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/SendController.php" afterPath="$PROJECT_DIR$/api/index/controller/SendController.php" /> |
7 | </list> | 7 | </list> |
8 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | 8 | <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> |
@@ -13,27 +13,7 @@ | @@ -13,27 +13,7 @@ | ||
13 | <option name="LAST_RESOLUTION" value="IGNORE" /> | 13 | <option name="LAST_RESOLUTION" value="IGNORE" /> |
14 | </component> | 14 | </component> |
15 | <component name="FileEditorManager"> | 15 | <component name="FileEditorManager"> |
16 | - <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> | ||
17 | - <file leaf-file-name="SendController.php" pinned="false" current-in-tab="true"> | ||
18 | - <entry file="file://$PROJECT_DIR$/api/index/controller/SendController.php"> | ||
19 | - <provider selected="true" editor-type-id="text-editor"> | ||
20 | - <state relative-caret-position="275"> | ||
21 | - <caret line="45" column="38" lean-forward="true" selection-start-line="45" selection-start-column="38" selection-end-line="45" selection-end-column="38" /> | ||
22 | - <folding> | ||
23 | - <element signature="e#2747#2931#0#PHP" expanded="false" /> | ||
24 | - <element signature="e#2936#3130#0#PHP" expanded="false" /> | ||
25 | - <element signature="e#3136#4310#0#PHP" expanded="false" /> | ||
26 | - <element signature="e#4315#5875#0#PHP" expanded="false" /> | ||
27 | - <element signature="e#5881#6813#0#PHP" expanded="false" /> | ||
28 | - <element signature="e#6818#8140#0#PHP" expanded="false" /> | ||
29 | - <element signature="e#8146#8955#0#PHP" expanded="false" /> | ||
30 | - <element signature="e#8960#10197#0#PHP" expanded="false" /> | ||
31 | - </folding> | ||
32 | - </state> | ||
33 | - </provider> | ||
34 | - </entry> | ||
35 | - </file> | ||
36 | - </leaf> | 16 | + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300" /> |
37 | </component> | 17 | </component> |
38 | <component name="FileTemplateManagerImpl"> | 18 | <component name="FileTemplateManagerImpl"> |
39 | <option name="RECENT_TEMPLATES"> | 19 | <option name="RECENT_TEMPLATES"> |
@@ -60,7 +40,6 @@ | @@ -60,7 +40,6 @@ | ||
60 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/index.html" /> | 40 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/index.html" /> |
61 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/account.html" /> | 41 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/account.html" /> |
62 | <option value="$PROJECT_DIR$/app/user/controller/AdminIndexController.php" /> | 42 | <option value="$PROJECT_DIR$/app/user/controller/AdminIndexController.php" /> |
63 | - <option value="$PROJECT_DIR$/api/index/controller/FinanceController.php" /> | ||
64 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/statistic/index.html" /> | 43 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/statistic/index.html" /> |
65 | <option value="$PROJECT_DIR$/app/admin/controller/StatisticController.php" /> | 44 | <option value="$PROJECT_DIR$/app/admin/controller/StatisticController.php" /> |
66 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/demand/index.html" /> | 45 | <option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/demand/index.html" /> |
@@ -95,6 +74,7 @@ | @@ -95,6 +74,7 @@ | ||
95 | <option value="$PROJECT_DIR$/api/index/controller/ResourceController.php" /> | 74 | <option value="$PROJECT_DIR$/api/index/controller/ResourceController.php" /> |
96 | <option value="$PROJECT_DIR$/api/index/controller/ReleaseController.php" /> | 75 | <option value="$PROJECT_DIR$/api/index/controller/ReleaseController.php" /> |
97 | <option value="$PROJECT_DIR$/api/index/controller/SendController.php" /> | 76 | <option value="$PROJECT_DIR$/api/index/controller/SendController.php" /> |
77 | + <option value="$PROJECT_DIR$/api/index/controller/FinanceController.php" /> | ||
98 | </list> | 78 | </list> |
99 | </option> | 79 | </option> |
100 | </component> | 80 | </component> |
@@ -112,9 +92,9 @@ | @@ -112,9 +92,9 @@ | ||
112 | <sorting>DEFINITION_ORDER</sorting> | 92 | <sorting>DEFINITION_ORDER</sorting> |
113 | </component> | 93 | </component> |
114 | <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> | 94 | <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> |
115 | - <component name="ProjectFrameBounds" extendedState="1"> | ||
116 | - <option name="x" value="-57" /> | ||
117 | - <option name="y" value="81" /> | 95 | + <component name="ProjectFrameBounds"> |
96 | + <option name="x" value="285" /> | ||
97 | + <option name="y" value="92" /> | ||
118 | <option name="width" value="1935" /> | 98 | <option name="width" value="1935" /> |
119 | <option name="height" value="952" /> | 99 | <option name="height" value="952" /> |
120 | </component> | 100 | </component> |
@@ -229,18 +209,17 @@ | @@ -229,18 +209,17 @@ | ||
229 | <workItem from="1569315557660" duration="58000" /> | 209 | <workItem from="1569315557660" duration="58000" /> |
230 | <workItem from="1569389764200" duration="1390000" /> | 210 | <workItem from="1569389764200" duration="1390000" /> |
231 | <workItem from="1569391173899" duration="1945000" /> | 211 | <workItem from="1569391173899" duration="1945000" /> |
232 | - <workItem from="1569397269236" duration="153000" /> | 212 | + <workItem from="1569397269236" duration="1915000" /> |
233 | </task> | 213 | </task> |
234 | <servers /> | 214 | <servers /> |
235 | </component> | 215 | </component> |
236 | <component name="TimeTrackingManager"> | 216 | <component name="TimeTrackingManager"> |
237 | - <option name="totallyTimeSpent" value="360972000" /> | 217 | + <option name="totallyTimeSpent" value="362734000" /> |
238 | </component> | 218 | </component> |
239 | <component name="ToolWindowManager"> | 219 | <component name="ToolWindowManager"> |
240 | - <frame x="-57" y="81" width="1935" height="952" extended-state="1" /> | ||
241 | - <editor active="true" /> | 220 | + <frame x="285" y="92" width="1935" height="952" extended-state="0" /> |
242 | <layout> | 221 | <layout> |
243 | - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1664" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | 222 | + <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1664" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> |
244 | <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | 223 | <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> |
245 | <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34076828" sideWeight="0.50296295" order="7" side_tool="true" content_ui="tabs" /> | 224 | <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34076828" sideWeight="0.50296295" order="7" side_tool="true" content_ui="tabs" /> |
246 | <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | 225 | <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> |
@@ -457,13 +436,6 @@ | @@ -457,13 +436,6 @@ | ||
457 | </state> | 436 | </state> |
458 | </provider> | 437 | </provider> |
459 | </entry> | 438 | </entry> |
460 | - <entry file="file://$PROJECT_DIR$/api/index/controller/FinanceController.php"> | ||
461 | - <provider selected="true" editor-type-id="text-editor"> | ||
462 | - <state relative-caret-position="375"> | ||
463 | - <caret line="43" column="27" lean-forward="false" selection-start-line="43" selection-start-column="27" selection-end-line="43" selection-end-column="27" /> | ||
464 | - </state> | ||
465 | - </provider> | ||
466 | - </entry> | ||
467 | <entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/finance/edit.html"> | 439 | <entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/finance/edit.html"> |
468 | <provider selected="true" editor-type-id="text-editor"> | 440 | <provider selected="true" editor-type-id="text-editor"> |
469 | <state relative-caret-position="-1320"> | 441 | <state relative-caret-position="-1320"> |
@@ -612,9 +584,37 @@ | @@ -612,9 +584,37 @@ | ||
612 | </state> | 584 | </state> |
613 | </provider> | 585 | </provider> |
614 | </entry> | 586 | </entry> |
587 | + <entry file="file://$PROJECT_DIR$/api/index/controller/FinanceController.php"> | ||
588 | + <provider selected="true" editor-type-id="text-editor"> | ||
589 | + <state relative-caret-position="340"> | ||
590 | + <caret line="49" column="35" lean-forward="true" selection-start-line="49" selection-start-column="35" selection-end-line="49" selection-end-column="35" /> | ||
591 | + <folding> | ||
592 | + <element signature="e#300#1179#0#PHP" expanded="false" /> | ||
593 | + </folding> | ||
594 | + </state> | ||
595 | + </provider> | ||
596 | + </entry> | ||
597 | + <entry file="file://$PROJECT_DIR$/api/index/controller/SendController.php"> | ||
598 | + <provider selected="true" editor-type-id="text-editor"> | ||
599 | + <state relative-caret-position="414"> | ||
600 | + <caret line="300" column="8" lean-forward="false" selection-start-line="300" selection-start-column="8" selection-end-line="306" selection-end-column="38" /> | ||
601 | + <folding> | ||
602 | + <element signature="e#296#1102#0#PHP" expanded="false" /> | ||
603 | + <element signature="e#1108#2740#0#PHP" expanded="false" /> | ||
604 | + <element signature="e#2746#2930#0#PHP" expanded="false" /> | ||
605 | + <element signature="e#2935#3129#0#PHP" expanded="false" /> | ||
606 | + <element signature="e#3135#4309#0#PHP" expanded="false" /> | ||
607 | + <element signature="e#4314#6247#0#PHP" expanded="false" /> | ||
608 | + <element signature="e#6253#7185#0#PHP" expanded="false" /> | ||
609 | + <element signature="e#7190#8878#0#PHP" expanded="false" /> | ||
610 | + <element signature="e#8884#9693#0#PHP" expanded="false" /> | ||
611 | + </folding> | ||
612 | + </state> | ||
613 | + </provider> | ||
614 | + </entry> | ||
615 | <entry file="file://$PROJECT_DIR$/api/index/controller/ResourceController.php"> | 615 | <entry file="file://$PROJECT_DIR$/api/index/controller/ResourceController.php"> |
616 | <provider selected="true" editor-type-id="text-editor"> | 616 | <provider selected="true" editor-type-id="text-editor"> |
617 | - <state relative-caret-position="-9"> | 617 | + <state relative-caret-position="540"> |
618 | <caret line="240" column="5" lean-forward="true" selection-start-line="240" selection-start-column="5" selection-end-line="240" selection-end-column="5" /> | 618 | <caret line="240" column="5" lean-forward="true" selection-start-line="240" selection-start-column="5" selection-end-line="240" selection-end-column="5" /> |
619 | <folding> | 619 | <folding> |
620 | <element signature="e#346#543#0#PHP" expanded="false" /> | 620 | <element signature="e#346#543#0#PHP" expanded="false" /> |
@@ -652,22 +652,5 @@ | @@ -652,22 +652,5 @@ | ||
652 | </state> | 652 | </state> |
653 | </provider> | 653 | </provider> |
654 | </entry> | 654 | </entry> |
655 | - <entry file="file://$PROJECT_DIR$/api/index/controller/SendController.php"> | ||
656 | - <provider selected="true" editor-type-id="text-editor"> | ||
657 | - <state relative-caret-position="275"> | ||
658 | - <caret line="45" column="38" lean-forward="true" selection-start-line="45" selection-start-column="38" selection-end-line="45" selection-end-column="38" /> | ||
659 | - <folding> | ||
660 | - <element signature="e#2747#2931#0#PHP" expanded="false" /> | ||
661 | - <element signature="e#2936#3130#0#PHP" expanded="false" /> | ||
662 | - <element signature="e#3136#4310#0#PHP" expanded="false" /> | ||
663 | - <element signature="e#4315#5875#0#PHP" expanded="false" /> | ||
664 | - <element signature="e#5881#6813#0#PHP" expanded="false" /> | ||
665 | - <element signature="e#6818#8140#0#PHP" expanded="false" /> | ||
666 | - <element signature="e#8146#8955#0#PHP" expanded="false" /> | ||
667 | - <element signature="e#8960#10197#0#PHP" expanded="false" /> | ||
668 | - </folding> | ||
669 | - </state> | ||
670 | - </provider> | ||
671 | - </entry> | ||
672 | </component> | 655 | </component> |
673 | </project> | 656 | </project> |
@@ -45,26 +45,35 @@ class FinanceController extends RestBaseController | @@ -45,26 +45,35 @@ class FinanceController extends RestBaseController | ||
45 | { | 45 | { |
46 | $user_id = $this->getUserId(); | 46 | $user_id = $this->getUserId(); |
47 | $param = $this->request->param(); | 47 | $param = $this->request->param(); |
48 | - $validate = new Validate([ | ||
49 | - 'company_name' => 'require', | ||
50 | - 'employing' => 'require', | ||
51 | - 'money'=>'require|number', | ||
52 | - 'money_purpose'=>'require', | ||
53 | - 'work_adress'=>'require', | ||
54 | - 'user_name'=>'require', | ||
55 | - 'user_tel'=>'require|number|max:11', | ||
56 | - 'user_email'=>'require' | ||
57 | - ]); | ||
58 | - if (!$validate->check($param)) { | ||
59 | - $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
60 | - } | ||
61 | $param['user_id'] = $user_id; | 48 | $param['user_id'] = $user_id; |
62 | $param['create_time'] = time(); | 49 | $param['create_time'] = time(); |
63 | - $data = Db::name('finance') | ||
64 | - ->insert($param); | ||
65 | - if(empty($data)){ | ||
66 | - $this->error(['code'=>40006,'msg'=>'sql执行失败']); | 50 | + if($param['status'] == 0) { |
51 | + $data = Db::name('job') | ||
52 | + ->insert($param); | ||
53 | + if (empty($data)) { | ||
54 | + $this->error(['code' => 40006, 'msg' => 'sql执行失败']); | ||
55 | + } | ||
56 | + $this->success('SUCCESS'); | ||
57 | + }else{ | ||
58 | + $validate = new Validate([ | ||
59 | + 'company_name' => 'require', | ||
60 | + 'employing' => 'require', | ||
61 | + 'money'=>'require|number', | ||
62 | + 'money_purpose'=>'require', | ||
63 | + 'work_adress'=>'require', | ||
64 | + 'user_name'=>'require', | ||
65 | + 'user_tel'=>'require|number|max:11', | ||
66 | + 'user_email'=>'require' | ||
67 | + ]); | ||
68 | + if (!$validate->check($param)) { | ||
69 | + $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
70 | + } | ||
71 | + $data = Db::name('finance') | ||
72 | + ->insert($param); | ||
73 | + if(empty($data)){ | ||
74 | + $this->error(['code'=>40006,'msg'=>'sql执行失败']); | ||
75 | + } | ||
76 | + $this->success('SUCCESS'); | ||
67 | } | 77 | } |
68 | - $this->success('SUCCESS'); | ||
69 | } | 78 | } |
70 | } | 79 | } |
@@ -56,7 +56,6 @@ class SendController extends RestBaseController | @@ -56,7 +56,6 @@ class SendController extends RestBaseController | ||
56 | $param['end_time'] = strtotime($param['end_time']); | 56 | $param['end_time'] = strtotime($param['end_time']); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | - | ||
60 | if($param['status'] == 0){ | 59 | if($param['status'] == 0){ |
61 | $data = Db::name('job') | 60 | $data = Db::name('job') |
62 | ->insert($param); | 61 | ->insert($param); |
@@ -156,28 +155,37 @@ class SendController extends RestBaseController | @@ -156,28 +155,37 @@ class SendController extends RestBaseController | ||
156 | if(empty($param['max_age'])){ | 155 | if(empty($param['max_age'])){ |
157 | $param['max_age'] = 45; | 156 | $param['max_age'] = 45; |
158 | } | 157 | } |
159 | - $validate = new Validate([ | ||
160 | - 'job_title' => 'require', | ||
161 | - 'city'=>'require', | ||
162 | - 'linkman' => 'require', | ||
163 | - 'workplace'=>'require', | ||
164 | - 'needpeople' =>'require|number', | ||
165 | - 'sex'=>'require|number', | ||
166 | - 'education'=>'require', | ||
167 | - 'company_name'=>'require', | ||
168 | - 'empoying'=>'require', | ||
169 | - 'content'=>'require', | ||
170 | - 'linkman_tel'=>'require|number|max:11', | ||
171 | - ]); | ||
172 | - if (!$validate->check($param)) { | ||
173 | - $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
174 | - } | ||
175 | - $data = Db::name('job') | ||
176 | - ->insert($param); | ||
177 | - if(empty($data)){ | ||
178 | - $this->error(['code'=>40006,'msg'=>'sql执行失败']); | 158 | + if($param['status'] == 0) { |
159 | + $data = Db::name('job') | ||
160 | + ->insert($param); | ||
161 | + if (empty($data)) { | ||
162 | + $this->error(['code' => 40006, 'msg' => 'sql执行失败']); | ||
163 | + } | ||
164 | + $this->success('SUCCESS'); | ||
165 | + }else{ | ||
166 | + $validate = new Validate([ | ||
167 | + 'job_title' => 'require', | ||
168 | + 'city'=>'require', | ||
169 | + 'linkman' => 'require', | ||
170 | + 'workplace'=>'require', | ||
171 | + 'needpeople' =>'require|number', | ||
172 | + 'sex'=>'require|number', | ||
173 | + 'education'=>'require', | ||
174 | + 'company_name'=>'require', | ||
175 | + 'empoying'=>'require', | ||
176 | + 'content'=>'require', | ||
177 | + 'linkman_tel'=>'require|number|max:11', | ||
178 | + ]); | ||
179 | + if (!$validate->check($param)) { | ||
180 | + $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
181 | + } | ||
182 | + $data = Db::name('job') | ||
183 | + ->insert($param); | ||
184 | + if(empty($data)){ | ||
185 | + $this->error(['code'=>40006,'msg'=>'sql执行失败']); | ||
186 | + } | ||
187 | + $this->success('SUCCESS'); | ||
179 | } | 188 | } |
180 | - $this->success('SUCCESS'); | ||
181 | } | 189 | } |
182 | 190 | ||
183 | /** | 191 | /** |
@@ -220,26 +228,36 @@ class SendController extends RestBaseController | @@ -220,26 +228,36 @@ class SendController extends RestBaseController | ||
220 | $param['end_time'] = strtotime($param['end_time']); | 228 | $param['end_time'] = strtotime($param['end_time']); |
221 | } | 229 | } |
222 | } | 230 | } |
223 | - $validate = new Validate([ | ||
224 | - 'job_title' => 'require', | ||
225 | - 'linkman' => 'require', | ||
226 | - 'linkman_tel'=>'require|number|max:11', | ||
227 | - 'needpeople' =>'require|number', | ||
228 | - 'payroll'=>'require|number', | ||
229 | - 'city'=>'require', | ||
230 | - 'adress'=>'require', | ||
231 | - 'company_name'=>'require', | ||
232 | - 'content'=>'require', | ||
233 | - ]); | ||
234 | - if (!$validate->check($param)) { | ||
235 | - $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
236 | - } | ||
237 | - $data = Db::name('job') | ||
238 | - ->insert($param); | ||
239 | - if(empty($data)){ | ||
240 | - $this->error(['code'=>40006,'msg'=>'sql执行失败']); | 231 | + |
232 | + if($param['status'] == 0) { | ||
233 | + $data = Db::name('job') | ||
234 | + ->insert($param); | ||
235 | + if (empty($data)) { | ||
236 | + $this->error(['code' => 40006, 'msg' => 'sql执行失败']); | ||
237 | + } | ||
238 | + $this->success('SUCCESS'); | ||
239 | + }else{ | ||
240 | + $validate = new Validate([ | ||
241 | + 'job_title' => 'require', | ||
242 | + 'linkman' => 'require', | ||
243 | + 'linkman_tel'=>'require|number|max:11', | ||
244 | + 'needpeople' =>'require|number', | ||
245 | + 'payroll'=>'require|number', | ||
246 | + 'city'=>'require', | ||
247 | + 'adress'=>'require', | ||
248 | + 'company_name'=>'require', | ||
249 | + 'content'=>'require', | ||
250 | + ]); | ||
251 | + if (!$validate->check($param)) { | ||
252 | + $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
253 | + } | ||
254 | + $data = Db::name('job') | ||
255 | + ->insert($param); | ||
256 | + if(empty($data)){ | ||
257 | + $this->error(['code'=>40006,'msg'=>'sql执行失败']); | ||
258 | + } | ||
259 | + $this->success('SUCCESS'); | ||
241 | } | 260 | } |
242 | - $this->success('SUCCESS'); | ||
243 | } | 261 | } |
244 | 262 | ||
245 | /** | 263 | /** |
@@ -280,24 +298,33 @@ class SendController extends RestBaseController | @@ -280,24 +298,33 @@ class SendController extends RestBaseController | ||
280 | $param['end_time'] = strtotime($param['end_time']); | 298 | $param['end_time'] = strtotime($param['end_time']); |
281 | } | 299 | } |
282 | } | 300 | } |
283 | - $validate = new Validate([ | ||
284 | - 'job_title' => 'require', | ||
285 | - 'city'=>'require', | ||
286 | - 'linkman' => 'require', | ||
287 | - 'adress'=>'require', | ||
288 | - 'linkman_tel'=>'require|number|max:11', | ||
289 | - 'company_name'=>'require', | ||
290 | - 'content'=>'require', | ||
291 | - ]); | ||
292 | - if (!$validate->check($param)) { | ||
293 | - $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
294 | - } | ||
295 | - $data = Db::name('job') | ||
296 | - ->insert($param); | ||
297 | - if(empty($data)){ | ||
298 | - $this->error(['code'=>40006,'msg'=>'sql执行失败']); | 301 | + if($param['status'] == 0) { |
302 | + $data = Db::name('job') | ||
303 | + ->insert($param); | ||
304 | + if (empty($data)) { | ||
305 | + $this->error(['code' => 40006, 'msg' => 'sql执行失败']); | ||
306 | + } | ||
307 | + $this->success('SUCCESS'); | ||
308 | + }else{ | ||
309 | + $validate = new Validate([ | ||
310 | + 'job_title' => 'require', | ||
311 | + 'city'=>'require', | ||
312 | + 'linkman' => 'require', | ||
313 | + 'adress'=>'require', | ||
314 | + 'linkman_tel'=>'require|number|max:11', | ||
315 | + 'company_name'=>'require', | ||
316 | + 'content'=>'require', | ||
317 | + ]); | ||
318 | + if (!$validate->check($param)) { | ||
319 | + $this->error(['code'=>40005,'msg'=>$validate->getError()]); | ||
320 | + } | ||
321 | + $data = Db::name('job') | ||
322 | + ->insert($param); | ||
323 | + if(empty($data)){ | ||
324 | + $this->error(['code'=>40006,'msg'=>'sql执行失败']); | ||
325 | + } | ||
326 | + $this->success('SUCCESS'); | ||
299 | } | 327 | } |
300 | - $this->success('SUCCESS'); | ||
301 | } | 328 | } |
302 | 329 | ||
303 | } | 330 | } |
-
请 注册 或 登录 后发表评论