作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改商城订单

@@ -63,8 +63,8 @@ @@ -63,8 +63,8 @@
63 <file leaf-file-name="UserController.php" pinned="false" current-in-tab="true"> 63 <file leaf-file-name="UserController.php" pinned="false" current-in-tab="true">
64 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php"> 64 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
65 <provider selected="true" editor-type-id="text-editor"> 65 <provider selected="true" editor-type-id="text-editor">
66 - <state relative-caret-position="430">  
67 - <caret line="482" column="53" lean-forward="false" selection-start-line="482" selection-start-column="53" selection-end-line="482" selection-end-column="53" /> 66 + <state relative-caret-position="555">
  67 + <caret line="418" column="35" lean-forward="true" selection-start-line="418" selection-start-column="35" selection-end-line="418" selection-end-column="35" />
68 <folding> 68 <folding>
69 <element signature="e#366#715#0#PHP" expanded="false" /> 69 <element signature="e#366#715#0#PHP" expanded="false" />
70 <element signature="e#720#1485#0#PHP" expanded="false" /> 70 <element signature="e#720#1485#0#PHP" expanded="false" />
@@ -87,31 +87,32 @@ @@ -87,31 +87,32 @@
87 <element signature="e#8604#9152#0#PHP" expanded="false" /> 87 <element signature="e#8604#9152#0#PHP" expanded="false" />
88 <element signature="e#9157#10491#0#PHP" expanded="false" /> 88 <element signature="e#9157#10491#0#PHP" expanded="false" />
89 <element signature="e#10497#10953#0#PHP" expanded="false" /> 89 <element signature="e#10497#10953#0#PHP" expanded="false" />
90 - <element signature="e#10958#12350#0#PHP" expanded="false" />  
91 - <element signature="e#12373#12725#0#PHP" expanded="false" />  
92 - <element signature="e#14738#15199#0#PHP" expanded="false" />  
93 - <element signature="e#15204#17409#0#PHP" expanded="false" />  
94 - <element signature="e#17415#18024#0#PHP" expanded="false" />  
95 - <element signature="e#18029#19362#0#PHP" expanded="false" />  
96 - <element signature="e#19368#19725#0#PHP" expanded="false" />  
97 - <element signature="e#19730#20611#0#PHP" expanded="false" />  
98 - <element signature="e#20617#20969#0#PHP" expanded="false" />  
99 - <element signature="e#20974#22052#0#PHP" expanded="false" />  
100 - <element signature="e#22058#22413#0#PHP" expanded="false" />  
101 - <element signature="e#22418#23498#0#PHP" expanded="false" />  
102 - <element signature="e#23504#23928#0#PHP" expanded="false" />  
103 - <element signature="e#23933#24544#0#PHP" expanded="false" />  
104 - <element signature="e#24550#25046#0#PHP" expanded="false" />  
105 - <element signature="e#25051#26158#0#PHP" expanded="false" />  
106 - <element signature="e#26164#26448#0#PHP" expanded="false" />  
107 - <element signature="e#26453#27031#0#PHP" expanded="false" />  
108 - <element signature="e#27052#27371#0#PHP" expanded="false" />  
109 - <element signature="e#27377#27785#0#PHP" expanded="false" />  
110 - <element signature="e#27791#28550#0#PHP" expanded="false" />  
111 - <element signature="e#28570#29434#0#PHP" expanded="false" />  
112 - <element signature="e#29461#29861#0#PHP" expanded="false" />  
113 - <element signature="e#29885#30458#0#PHP" expanded="false" />  
114 - <element signature="e#30481#31291#0#PHP" expanded="false" /> 90 + <element signature="e#12310#12665#0#PHP" expanded="false" />
  91 + <element signature="e#12671#13355#0#PHP" expanded="false" />
  92 + <element signature="e#13360#14672#0#PHP" expanded="false" />
  93 + <element signature="e#14678#15139#0#PHP" expanded="false" />
  94 + <element signature="e#15144#17349#0#PHP" expanded="false" />
  95 + <element signature="e#17355#17964#0#PHP" expanded="false" />
  96 + <element signature="e#17969#19302#0#PHP" expanded="false" />
  97 + <element signature="e#19308#19665#0#PHP" expanded="false" />
  98 + <element signature="e#19670#20551#0#PHP" expanded="false" />
  99 + <element signature="e#20557#20909#0#PHP" expanded="false" />
  100 + <element signature="e#20914#21992#0#PHP" expanded="false" />
  101 + <element signature="e#21998#22353#0#PHP" expanded="false" />
  102 + <element signature="e#22358#23438#0#PHP" expanded="false" />
  103 + <element signature="e#23444#23868#0#PHP" expanded="false" />
  104 + <element signature="e#23873#24484#0#PHP" expanded="false" />
  105 + <element signature="e#24490#24986#0#PHP" expanded="false" />
  106 + <element signature="e#24991#26098#0#PHP" expanded="false" />
  107 + <element signature="e#26104#26388#0#PHP" expanded="false" />
  108 + <element signature="e#26393#26971#0#PHP" expanded="false" />
  109 + <element signature="e#26992#27311#0#PHP" expanded="false" />
  110 + <element signature="e#27317#27725#0#PHP" expanded="false" />
  111 + <element signature="e#27731#28490#0#PHP" expanded="false" />
  112 + <element signature="e#28510#29374#0#PHP" expanded="false" />
  113 + <element signature="e#29401#29801#0#PHP" expanded="false" />
  114 + <element signature="e#29825#30398#0#PHP" expanded="false" />
  115 + <element signature="e#30421#31231#0#PHP" expanded="false" />
115 </folding> 116 </folding>
116 </state> 117 </state>
117 </provider> 118 </provider>
@@ -206,8 +207,8 @@ @@ -206,8 +207,8 @@
206 </component> 207 </component>
207 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 208 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
208 <component name="ProjectFrameBounds" extendedState="1"> 209 <component name="ProjectFrameBounds" extendedState="1">
209 - <option name="x" value="198" />  
210 - <option name="y" value="46" /> 210 + <option name="x" value="260" />
  211 + <option name="y" value="76" />
211 <option name="width" value="1582" /> 212 <option name="width" value="1582" />
212 <option name="height" value="1021" /> 213 <option name="height" value="1021" />
213 </component> 214 </component>
@@ -226,8 +227,6 @@ @@ -226,8 +227,6 @@
226 <foldersAlwaysOnTop value="true" /> 227 <foldersAlwaysOnTop value="true" />
227 </navigator> 228 </navigator>
228 <panes> 229 <panes>
229 - <pane id="Scratches" />  
230 - <pane id="Scope" />  
231 <pane id="ProjectPane"> 230 <pane id="ProjectPane">
232 <subPane> 231 <subPane>
233 <expand> 232 <expand>
@@ -257,6 +256,8 @@ @@ -257,6 +256,8 @@
257 <select /> 256 <select />
258 </subPane> 257 </subPane>
259 </pane> 258 </pane>
  259 + <pane id="Scratches" />
  260 + <pane id="Scope" />
260 </panes> 261 </panes>
261 </component> 262 </component>
262 <component name="PropertiesComponent"> 263 <component name="PropertiesComponent">
@@ -354,26 +355,27 @@ @@ -354,26 +355,27 @@
354 <workItem from="1575419186725" duration="599000" /> 355 <workItem from="1575419186725" duration="599000" />
355 <workItem from="1575420787741" duration="2879000" /> 356 <workItem from="1575420787741" duration="2879000" />
356 <workItem from="1575431441427" duration="8414000" /> 357 <workItem from="1575431441427" duration="8414000" />
  358 + <workItem from="1575444399653" duration="1070000" />
357 </task> 359 </task>
358 <servers /> 360 <servers />
359 </component> 361 </component>
360 <component name="TimeTrackingManager"> 362 <component name="TimeTrackingManager">
361 - <option name="totallyTimeSpent" value="453649000" /> 363 + <option name="totallyTimeSpent" value="454719000" />
362 </component> 364 </component>
363 <component name="ToolWindowManager"> 365 <component name="ToolWindowManager">
364 - <frame x="198" y="46" width="1582" height="1021" extended-state="1" /> 366 + <frame x="260" y="76" width="1582" height="1021" extended-state="1" />
365 <editor active="true" /> 367 <editor active="true" />
366 <layout> 368 <layout>
367 - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17214192" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> 369 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.174113" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
368 <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" /> 370 <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" />
369 <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.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> 371 <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.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
370 <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32982457" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> 372 <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32982457" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
371 - <window_info id="Run" 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="2" side_tool="false" content_ui="tabs" />  
372 <window_info id="Version Control" 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="7" side_tool="false" content_ui="tabs" /> 373 <window_info id="Version Control" 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="7" side_tool="false" content_ui="tabs" />
  374 + <window_info id="Run" 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="2" side_tool="false" content_ui="tabs" />
373 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> 375 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
374 <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25086308" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> 376 <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25086308" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
375 - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />  
376 <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> 377 <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
  378 + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
377 <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> 379 <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
378 <window_info id="Message" 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="0" side_tool="false" content_ui="tabs" /> 380 <window_info id="Message" 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="0" side_tool="false" content_ui="tabs" />
379 <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> 381 <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@@ -859,8 +861,8 @@ @@ -859,8 +861,8 @@
859 </entry> 861 </entry>
860 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php"> 862 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
861 <provider selected="true" editor-type-id="text-editor"> 863 <provider selected="true" editor-type-id="text-editor">
862 - <state relative-caret-position="430">  
863 - <caret line="482" column="53" lean-forward="false" selection-start-line="482" selection-start-column="53" selection-end-line="482" selection-end-column="53" /> 864 + <state relative-caret-position="555">
  865 + <caret line="418" column="35" lean-forward="true" selection-start-line="418" selection-start-column="35" selection-end-line="418" selection-end-column="35" />
864 <folding> 866 <folding>
865 <element signature="e#366#715#0#PHP" expanded="false" /> 867 <element signature="e#366#715#0#PHP" expanded="false" />
866 <element signature="e#720#1485#0#PHP" expanded="false" /> 868 <element signature="e#720#1485#0#PHP" expanded="false" />
@@ -883,31 +885,32 @@ @@ -883,31 +885,32 @@
883 <element signature="e#8604#9152#0#PHP" expanded="false" /> 885 <element signature="e#8604#9152#0#PHP" expanded="false" />
884 <element signature="e#9157#10491#0#PHP" expanded="false" /> 886 <element signature="e#9157#10491#0#PHP" expanded="false" />
885 <element signature="e#10497#10953#0#PHP" expanded="false" /> 887 <element signature="e#10497#10953#0#PHP" expanded="false" />
886 - <element signature="e#10958#12350#0#PHP" expanded="false" />  
887 - <element signature="e#12373#12725#0#PHP" expanded="false" />  
888 - <element signature="e#14738#15199#0#PHP" expanded="false" />  
889 - <element signature="e#15204#17409#0#PHP" expanded="false" />  
890 - <element signature="e#17415#18024#0#PHP" expanded="false" />  
891 - <element signature="e#18029#19362#0#PHP" expanded="false" />  
892 - <element signature="e#19368#19725#0#PHP" expanded="false" />  
893 - <element signature="e#19730#20611#0#PHP" expanded="false" />  
894 - <element signature="e#20617#20969#0#PHP" expanded="false" />  
895 - <element signature="e#20974#22052#0#PHP" expanded="false" />  
896 - <element signature="e#22058#22413#0#PHP" expanded="false" />  
897 - <element signature="e#22418#23498#0#PHP" expanded="false" />  
898 - <element signature="e#23504#23928#0#PHP" expanded="false" />  
899 - <element signature="e#23933#24544#0#PHP" expanded="false" />  
900 - <element signature="e#24550#25046#0#PHP" expanded="false" />  
901 - <element signature="e#25051#26158#0#PHP" expanded="false" />  
902 - <element signature="e#26164#26448#0#PHP" expanded="false" />  
903 - <element signature="e#26453#27031#0#PHP" expanded="false" />  
904 - <element signature="e#27052#27371#0#PHP" expanded="false" />  
905 - <element signature="e#27377#27785#0#PHP" expanded="false" />  
906 - <element signature="e#27791#28550#0#PHP" expanded="false" />  
907 - <element signature="e#28570#29434#0#PHP" expanded="false" />  
908 - <element signature="e#29461#29861#0#PHP" expanded="false" />  
909 - <element signature="e#29885#30458#0#PHP" expanded="false" />  
910 - <element signature="e#30481#31291#0#PHP" expanded="false" /> 888 + <element signature="e#12310#12665#0#PHP" expanded="false" />
  889 + <element signature="e#12671#13355#0#PHP" expanded="false" />
  890 + <element signature="e#13360#14672#0#PHP" expanded="false" />
  891 + <element signature="e#14678#15139#0#PHP" expanded="false" />
  892 + <element signature="e#15144#17349#0#PHP" expanded="false" />
  893 + <element signature="e#17355#17964#0#PHP" expanded="false" />
  894 + <element signature="e#17969#19302#0#PHP" expanded="false" />
  895 + <element signature="e#19308#19665#0#PHP" expanded="false" />
  896 + <element signature="e#19670#20551#0#PHP" expanded="false" />
  897 + <element signature="e#20557#20909#0#PHP" expanded="false" />
  898 + <element signature="e#20914#21992#0#PHP" expanded="false" />
  899 + <element signature="e#21998#22353#0#PHP" expanded="false" />
  900 + <element signature="e#22358#23438#0#PHP" expanded="false" />
  901 + <element signature="e#23444#23868#0#PHP" expanded="false" />
  902 + <element signature="e#23873#24484#0#PHP" expanded="false" />
  903 + <element signature="e#24490#24986#0#PHP" expanded="false" />
  904 + <element signature="e#24991#26098#0#PHP" expanded="false" />
  905 + <element signature="e#26104#26388#0#PHP" expanded="false" />
  906 + <element signature="e#26393#26971#0#PHP" expanded="false" />
  907 + <element signature="e#26992#27311#0#PHP" expanded="false" />
  908 + <element signature="e#27317#27725#0#PHP" expanded="false" />
  909 + <element signature="e#27731#28490#0#PHP" expanded="false" />
  910 + <element signature="e#28510#29374#0#PHP" expanded="false" />
  911 + <element signature="e#29401#29801#0#PHP" expanded="false" />
  912 + <element signature="e#29825#30398#0#PHP" expanded="false" />
  913 + <element signature="e#30421#31231#0#PHP" expanded="false" />
911 </folding> 914 </folding>
912 </state> 915 </state>
913 </provider> 916 </provider>
@@ -397,28 +397,27 @@ class UserController extends RestBaseController @@ -397,28 +397,27 @@ class UserController extends RestBaseController
397 $data = Db::name('shoporder') 397 $data = Db::name('shoporder')
398 ->where('user_id',$user_id) 398 ->where('user_id',$user_id)
399 ->where('status',1) 399 ->where('status',1)
400 - ->field('id,number,create_time,num,shopgoods_id,total') 400 + ->field('id,number,create_time,num,shopgoods_id')
401 ->select() 401 ->select()
402 ->toArray(); 402 ->toArray();
403 - $this->success('success',$data);  
404 $data = $this->s_foreach($data); 403 $data = $this->s_foreach($data);
405 $this->success('SUCCESS',$data); 404 $this->success('SUCCESS',$data);
406 - }elseif ($status == 1){ 405 + }elseif ($status == 2){
407 //已发货的商城订单 406 //已发货的商城订单
408 $data = Db::name('shoporder') 407 $data = Db::name('shoporder')
409 ->where('user_id',$user_id) 408 ->where('user_id',$user_id)
410 ->where('status',2) 409 ->where('status',2)
411 - ->field('id,number,create_time,num,shopgoods_id,total') 410 + ->field('id,number,create_time,num,shopgoods_id')
412 ->select() 411 ->select()
413 ->toArray(); 412 ->toArray();
414 $data = $this->s_foreach($data); 413 $data = $this->s_foreach($data);
415 $this->success('SUCCESS',$data); 414 $this->success('SUCCESS',$data);
416 - }elseif ($status == 2){ 415 + }elseif ($status == 3){
417 //已完成的商城订单 416 //已完成的商城订单
418 $data = Db::name('shoporder') 417 $data = Db::name('shoporder')
419 ->where('user_id',$user_id) 418 ->where('user_id',$user_id)
420 ->where('status',3) 419 ->where('status',3)
421 - ->field('id,number,create_time,num,shopgoods_id,total') 420 + ->field('id,number,create_time,num,shopgoods_id')
422 ->select() 421 ->select()
423 ->toArray(); 422 ->toArray();
424 $data = $this->s_foreach($data); 423 $data = $this->s_foreach($data);
@@ -429,11 +428,11 @@ class UserController extends RestBaseController @@ -429,11 +428,11 @@ class UserController extends RestBaseController
429 //封装商城订单循环逻辑 428 //封装商城订单循环逻辑
430 public function s_foreach($res){ 429 public function s_foreach($res){
431 foreach ($res as &$v){ 430 foreach ($res as &$v){
  431 + $v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
432 $v['shopgoods_id'] = Db::name('shopgoods') 432 $v['shopgoods_id'] = Db::name('shopgoods')
433 - ->where('id',$v)  
434 - ->field('goods_name,thumbnail') 433 + ->where('id',$v['shopgoods_id'])
  434 + ->field('goods_name,thumbnail,price')
435 ->find(); 435 ->find();
436 - $v['thumbnail'] = cmf_get_image_preview_url($v['shopgoods_id']['thumbnail']);  
437 } 436 }
438 return $res; 437 return $res;
439 } 438 }