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

回收订单详情

@@ -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="1057">  
67 - <caret line="283" column="9" lean-forward="true" selection-start-line="283" selection-start-column="9" selection-end-line="283" selection-end-column="9" /> 66 + <state relative-caret-position="198">
  67 + <caret line="370" column="0" lean-forward="false" selection-start-line="370" selection-start-column="0" selection-end-line="371" selection-end-column="0" />
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" />
@@ -78,38 +78,40 @@ @@ -78,38 +78,40 @@
78 <element signature="e#4919#5120#0#PHP" expanded="false" /> 78 <element signature="e#4919#5120#0#PHP" expanded="false" />
79 <element signature="e#5126#5388#0#PHP" expanded="false" /> 79 <element signature="e#5126#5388#0#PHP" expanded="false" />
80 <element signature="e#5393#5598#0#PHP" expanded="false" /> 80 <element signature="e#5393#5598#0#PHP" expanded="false" />
81 - <element signature="e#7850#8130#0#PHP" expanded="false" />  
82 - <element signature="e#8135#8527#0#PHP" expanded="false" />  
83 - <element signature="e#8533#9081#0#PHP" expanded="false" />  
84 - <element signature="e#9086#10285#0#PHP" expanded="false" />  
85 - <element signature="e#10291#10747#0#PHP" expanded="false" />  
86 - <element signature="e#10752#12015#0#PHP" expanded="false" />  
87 - <element signature="e#12038#12390#0#PHP" expanded="false" />  
88 - <element signature="e#12396#13080#0#PHP" expanded="false" />  
89 - <element signature="e#13085#14344#0#PHP" expanded="false" />  
90 - <element signature="e#14350#14811#0#PHP" expanded="false" />  
91 - <element signature="e#14816#17021#0#PHP" expanded="false" />  
92 - <element signature="e#17027#17636#0#PHP" expanded="false" />  
93 - <element signature="e#17641#18974#0#PHP" expanded="false" />  
94 - <element signature="e#18980#19337#0#PHP" expanded="false" />  
95 - <element signature="e#19342#20223#0#PHP" expanded="false" />  
96 - <element signature="e#20229#20581#0#PHP" expanded="false" />  
97 - <element signature="e#20586#21663#0#PHP" expanded="false" />  
98 - <element signature="e#21669#22024#0#PHP" expanded="false" />  
99 - <element signature="e#22029#23109#0#PHP" expanded="false" />  
100 - <element signature="e#23115#23539#0#PHP" expanded="false" />  
101 - <element signature="e#23544#24155#0#PHP" expanded="false" />  
102 - <element signature="e#24161#24657#0#PHP" expanded="false" />  
103 - <element signature="e#24662#25769#0#PHP" expanded="false" />  
104 - <element signature="e#25775#26059#0#PHP" expanded="false" />  
105 - <element signature="e#26064#26642#0#PHP" expanded="false" />  
106 - <element signature="e#26663#26982#0#PHP" expanded="false" />  
107 - <element signature="e#26988#27396#0#PHP" expanded="false" />  
108 - <element signature="e#27402#28161#0#PHP" expanded="false" />  
109 - <element signature="e#28181#29045#0#PHP" expanded="false" />  
110 - <element signature="e#29072#29472#0#PHP" expanded="false" />  
111 - <element signature="e#29496#30069#0#PHP" expanded="false" />  
112 - <element signature="e#30092#30902#0#PHP" expanded="false" /> 81 + <element signature="e#5604#6045#0#PHP" expanded="false" />
  82 + <element signature="e#6050#7361#0#PHP" expanded="false" />
  83 + <element signature="e#6196#7355#0#PHP" expanded="false" />
  84 + <element signature="e#7384#7915#0#PHP" expanded="false" />
  85 + <element signature="e#7921#8201#0#PHP" expanded="false" />
  86 + <element signature="e#8206#8598#0#PHP" expanded="false" />
  87 + <element signature="e#8604#9152#0#PHP" expanded="false" />
  88 + <element signature="e#9157#10491#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#12731#13415#0#PHP" expanded="false" />
  93 + <element signature="e#13420#14679#0#PHP" expanded="false" />
  94 + <element signature="e#14685#15146#0#PHP" expanded="false" />
  95 + <element signature="e#15151#17356#0#PHP" expanded="false" />
  96 + <element signature="e#17362#17971#0#PHP" expanded="false" />
  97 + <element signature="e#17976#19309#0#PHP" expanded="false" />
  98 + <element signature="e#19315#19672#0#PHP" expanded="false" />
  99 + <element signature="e#20564#20916#0#PHP" expanded="false" />
  100 + <element signature="e#22026#22381#0#PHP" expanded="false" />
  101 + <element signature="e#22386#23466#0#PHP" expanded="false" />
  102 + <element signature="e#23472#23896#0#PHP" expanded="false" />
  103 + <element signature="e#23901#24512#0#PHP" expanded="false" />
  104 + <element signature="e#24518#25014#0#PHP" expanded="false" />
  105 + <element signature="e#25019#26126#0#PHP" expanded="false" />
  106 + <element signature="e#26132#26416#0#PHP" expanded="false" />
  107 + <element signature="e#26421#26999#0#PHP" expanded="false" />
  108 + <element signature="e#27020#27339#0#PHP" expanded="false" />
  109 + <element signature="e#27345#27753#0#PHP" expanded="false" />
  110 + <element signature="e#27759#28518#0#PHP" expanded="false" />
  111 + <element signature="e#28538#29402#0#PHP" expanded="false" />
  112 + <element signature="e#29429#29829#0#PHP" expanded="false" />
  113 + <element signature="e#29853#30426#0#PHP" expanded="false" />
  114 + <element signature="e#30449#31259#0#PHP" expanded="false" />
113 </folding> 115 </folding>
114 </state> 116 </state>
115 </provider> 117 </provider>
@@ -204,10 +206,10 @@ @@ -204,10 +206,10 @@
204 </component> 206 </component>
205 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 207 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
206 <component name="ProjectFrameBounds"> 208 <component name="ProjectFrameBounds">
207 - <option name="x" value="310" />  
208 - <option name="y" value="12" /> 209 + <option name="x" value="316" />
  210 + <option name="y" value="90" />
209 <option name="width" value="1582" /> 211 <option name="width" value="1582" />
210 - <option name="height" value="960" /> 212 + <option name="height" value="1009" />
211 </component> 213 </component>
212 <component name="ProjectView"> 214 <component name="ProjectView">
213 <navigator currentView="ProjectPane" proportions="" version="1"> 215 <navigator currentView="ProjectPane" proportions="" version="1">
@@ -351,15 +353,15 @@ @@ -351,15 +353,15 @@
351 <workItem from="1575359408189" duration="10054000" /> 353 <workItem from="1575359408189" duration="10054000" />
352 <workItem from="1575419186725" duration="599000" /> 354 <workItem from="1575419186725" duration="599000" />
353 <workItem from="1575420787741" duration="2879000" /> 355 <workItem from="1575420787741" duration="2879000" />
354 - <workItem from="1575431441427" duration="4417000" /> 356 + <workItem from="1575431441427" duration="6582000" />
355 </task> 357 </task>
356 <servers /> 358 <servers />
357 </component> 359 </component>
358 <component name="TimeTrackingManager"> 360 <component name="TimeTrackingManager">
359 - <option name="totallyTimeSpent" value="449652000" /> 361 + <option name="totallyTimeSpent" value="451817000" />
360 </component> 362 </component>
361 <component name="ToolWindowManager"> 363 <component name="ToolWindowManager">
362 - <frame x="310" y="12" width="1582" height="960" extended-state="0" /> 364 + <frame x="316" y="90" width="1582" height="1009" extended-state="0" />
363 <editor active="true" /> 365 <editor active="true" />
364 <layout> 366 <layout>
365 <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" /> 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" />
@@ -857,8 +859,8 @@ @@ -857,8 +859,8 @@
857 </entry> 859 </entry>
858 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php"> 860 <entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
859 <provider selected="true" editor-type-id="text-editor"> 861 <provider selected="true" editor-type-id="text-editor">
860 - <state relative-caret-position="1057">  
861 - <caret line="283" column="9" lean-forward="true" selection-start-line="283" selection-start-column="9" selection-end-line="283" selection-end-column="9" /> 862 + <state relative-caret-position="198">
  863 + <caret line="370" column="0" lean-forward="false" selection-start-line="370" selection-start-column="0" selection-end-line="371" selection-end-column="0" />
862 <folding> 864 <folding>
863 <element signature="e#366#715#0#PHP" expanded="false" /> 865 <element signature="e#366#715#0#PHP" expanded="false" />
864 <element signature="e#720#1485#0#PHP" expanded="false" /> 866 <element signature="e#720#1485#0#PHP" expanded="false" />
@@ -872,38 +874,40 @@ @@ -872,38 +874,40 @@
872 <element signature="e#4919#5120#0#PHP" expanded="false" /> 874 <element signature="e#4919#5120#0#PHP" expanded="false" />
873 <element signature="e#5126#5388#0#PHP" expanded="false" /> 875 <element signature="e#5126#5388#0#PHP" expanded="false" />
874 <element signature="e#5393#5598#0#PHP" expanded="false" /> 876 <element signature="e#5393#5598#0#PHP" expanded="false" />
875 - <element signature="e#7850#8130#0#PHP" expanded="false" />  
876 - <element signature="e#8135#8527#0#PHP" expanded="false" />  
877 - <element signature="e#8533#9081#0#PHP" expanded="false" />  
878 - <element signature="e#9086#10285#0#PHP" expanded="false" />  
879 - <element signature="e#10291#10747#0#PHP" expanded="false" />  
880 - <element signature="e#10752#12015#0#PHP" expanded="false" />  
881 - <element signature="e#12038#12390#0#PHP" expanded="false" />  
882 - <element signature="e#12396#13080#0#PHP" expanded="false" />  
883 - <element signature="e#13085#14344#0#PHP" expanded="false" />  
884 - <element signature="e#14350#14811#0#PHP" expanded="false" />  
885 - <element signature="e#14816#17021#0#PHP" expanded="false" />  
886 - <element signature="e#17027#17636#0#PHP" expanded="false" />  
887 - <element signature="e#17641#18974#0#PHP" expanded="false" />  
888 - <element signature="e#18980#19337#0#PHP" expanded="false" />  
889 - <element signature="e#19342#20223#0#PHP" expanded="false" />  
890 - <element signature="e#20229#20581#0#PHP" expanded="false" />  
891 - <element signature="e#20586#21663#0#PHP" expanded="false" />  
892 - <element signature="e#21669#22024#0#PHP" expanded="false" />  
893 - <element signature="e#22029#23109#0#PHP" expanded="false" />  
894 - <element signature="e#23115#23539#0#PHP" expanded="false" />  
895 - <element signature="e#23544#24155#0#PHP" expanded="false" />  
896 - <element signature="e#24161#24657#0#PHP" expanded="false" />  
897 - <element signature="e#24662#25769#0#PHP" expanded="false" />  
898 - <element signature="e#25775#26059#0#PHP" expanded="false" />  
899 - <element signature="e#26064#26642#0#PHP" expanded="false" />  
900 - <element signature="e#26663#26982#0#PHP" expanded="false" />  
901 - <element signature="e#26988#27396#0#PHP" expanded="false" />  
902 - <element signature="e#27402#28161#0#PHP" expanded="false" />  
903 - <element signature="e#28181#29045#0#PHP" expanded="false" />  
904 - <element signature="e#29072#29472#0#PHP" expanded="false" />  
905 - <element signature="e#29496#30069#0#PHP" expanded="false" />  
906 - <element signature="e#30092#30902#0#PHP" expanded="false" /> 877 + <element signature="e#5604#6045#0#PHP" expanded="false" />
  878 + <element signature="e#6050#7361#0#PHP" expanded="false" />
  879 + <element signature="e#6196#7355#0#PHP" expanded="false" />
  880 + <element signature="e#7384#7915#0#PHP" expanded="false" />
  881 + <element signature="e#7921#8201#0#PHP" expanded="false" />
  882 + <element signature="e#8206#8598#0#PHP" expanded="false" />
  883 + <element signature="e#8604#9152#0#PHP" expanded="false" />
  884 + <element signature="e#9157#10491#0#PHP" expanded="false" />
  885 + <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#12731#13415#0#PHP" expanded="false" />
  889 + <element signature="e#13420#14679#0#PHP" expanded="false" />
  890 + <element signature="e#14685#15146#0#PHP" expanded="false" />
  891 + <element signature="e#15151#17356#0#PHP" expanded="false" />
  892 + <element signature="e#17362#17971#0#PHP" expanded="false" />
  893 + <element signature="e#17976#19309#0#PHP" expanded="false" />
  894 + <element signature="e#19315#19672#0#PHP" expanded="false" />
  895 + <element signature="e#20564#20916#0#PHP" expanded="false" />
  896 + <element signature="e#22026#22381#0#PHP" expanded="false" />
  897 + <element signature="e#22386#23466#0#PHP" expanded="false" />
  898 + <element signature="e#23472#23896#0#PHP" expanded="false" />
  899 + <element signature="e#23901#24512#0#PHP" expanded="false" />
  900 + <element signature="e#24518#25014#0#PHP" expanded="false" />
  901 + <element signature="e#25019#26126#0#PHP" expanded="false" />
  902 + <element signature="e#26132#26416#0#PHP" expanded="false" />
  903 + <element signature="e#26421#26999#0#PHP" expanded="false" />
  904 + <element signature="e#27020#27339#0#PHP" expanded="false" />
  905 + <element signature="e#27345#27753#0#PHP" expanded="false" />
  906 + <element signature="e#27759#28518#0#PHP" expanded="false" />
  907 + <element signature="e#28538#29402#0#PHP" expanded="false" />
  908 + <element signature="e#29429#29829#0#PHP" expanded="false" />
  909 + <element signature="e#29853#30426#0#PHP" expanded="false" />
  910 + <element signature="e#30449#31259#0#PHP" expanded="false" />
907 </folding> 911 </folding>
908 </state> 912 </state>
909 </provider> 913 </provider>
@@ -273,6 +273,7 @@ class UserController extends RestBaseController @@ -273,6 +273,7 @@ class UserController extends RestBaseController
273 public function r_foreach($res){ 273 public function r_foreach($res){
274 foreach ($res as &$v){ 274 foreach ($res as &$v){
275 $v['attr_id'] = explode(',',$v['attr_id']); 275 $v['attr_id'] = explode(',',$v['attr_id']);
  276 + $v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
276 foreach ($v['attr_id'] as &$v1){ 277 foreach ($v['attr_id'] as &$v1){
277 $v1 = Db::name('attr') 278 $v1 = Db::name('attr')
278 ->alias('a') 279 ->alias('a')
@@ -336,7 +337,7 @@ class UserController extends RestBaseController @@ -336,7 +337,7 @@ class UserController extends RestBaseController
336 */ 337 */
337 public function orderDetail() 338 public function orderDetail()
338 { 339 {
339 -// $user_id = $this->getUserId(); 340 + $user_id = $this->getUserId();
340 //接收订单ID 341 //接收订单ID
341 $id = $this->request->param('order_id'); 342 $id = $this->request->param('order_id');
342 343
@@ -349,7 +350,8 @@ class UserController extends RestBaseController @@ -349,7 +350,8 @@ class UserController extends RestBaseController
349 $data['status'] = $res['status']; 350 $data['status'] = $res['status'];
350 $data['num'] = $res['num']; 351 $data['num'] = $res['num'];
351 $data['create_time'] = date('Y-m-d H:i:s',$res['create_time']); 352 $data['create_time'] = date('Y-m-d H:i:s',$res['create_time']);
352 - $data['recycle_id'] = Db::name('recycle')->where('id',$res['recycle_id'])->column('address'); 353 + $recycle_id = Db::name('recycle')->where('id',$res['recycle_id'])->field('address')->find();
  354 + $data['recycle_id'] = $recycle_id['address'];
353 $data['attr_id'] = explode(',',$res['attr_id']); 355 $data['attr_id'] = explode(',',$res['attr_id']);
354 foreach ($data['attr_id'] as &$v){ 356 foreach ($data['attr_id'] as &$v){
355 $v = Db::name('attr') 357 $v = Db::name('attr')
@@ -359,10 +361,11 @@ class UserController extends RestBaseController @@ -359,10 +361,11 @@ class UserController extends RestBaseController
359 ->field('a.attr_name,r.rgoods_name') 361 ->field('a.attr_name,r.rgoods_name')
360 ->find(); 362 ->find();
361 } 363 }
362 - 364 + $data['sub_time'] = $res['sub_time'];
363 $data['image'] = explode(',',$res['image']); 365 $data['image'] = explode(',',$res['image']);
364 $data['content'] = cmf_replace_content_file_url(htmlspecialchars_decode($res['content'])); 366 $data['content'] = cmf_replace_content_file_url(htmlspecialchars_decode($res['content']));
365 - $data['serve'] = Db::name('recyclefee')->where('id',1)->column('fee'); 367 + $serve = Db::name('recyclefee')->where('id',1)->field('fee')->find();
  368 + $data['serve'] = $serve['fee'];
366 $this->success('SUCCESS',$data); 369 $this->success('SUCCESS',$data);
367 } 370 }
368 371
@@ -375,7 +378,7 @@ class UserController extends RestBaseController @@ -375,7 +378,7 @@ class UserController extends RestBaseController
375 * 378 *
376 * @header name:XX-Token require:1 default: desc:token 379 * @header name:XX-Token require:1 default: desc:token
377 * 380 *
378 - * @param name:status require:1 other desc:订单状态(不传或者为0是 已兑换,1已发货,2已完成) 381 + * @param name:status require:1 other desc:订单状态(不传或者为1是 已兑换,2已发货,3已完成)
379 * 382 *
380 * @return id:订单ID 383 * @return id:订单ID
381 * @return num:订单号 384 * @return num:订单号
@@ -389,31 +392,35 @@ class UserController extends RestBaseController @@ -389,31 +392,35 @@ class UserController extends RestBaseController
389 { 392 {
390 $user_id = $this->getUserId(); 393 $user_id = $this->getUserId();
391 $status = $this->request->param('status',0,'intval'); 394 $status = $this->request->param('status',0,'intval');
392 - if(empty($status) || $status == 0){ 395 + if(empty($status) || $status == 1){
393 //已兑换的商城订单 396 //已兑换的商城订单
394 $data = Db::name('shoporder') 397 $data = Db::name('shoporder')
395 ->where('user_id',$user_id) 398 ->where('user_id',$user_id)
396 - ->where('status',0) 399 + ->where('status',1)
397 ->field('id,number,create_time,num,shopgoods_id,total') 400 ->field('id,number,create_time,num,shopgoods_id,total')
398 - ->select(); 401 + ->select()
  402 + ->toArray();
  403 + $this->success('success',$data);
399 $data = $this->s_foreach($data); 404 $data = $this->s_foreach($data);
400 $this->success('SUCCESS',$data); 405 $this->success('SUCCESS',$data);
401 }elseif ($status == 1){ 406 }elseif ($status == 1){
402 //已发货的商城订单 407 //已发货的商城订单
403 $data = Db::name('shoporder') 408 $data = Db::name('shoporder')
404 ->where('user_id',$user_id) 409 ->where('user_id',$user_id)
405 - ->where('status',1) 410 + ->where('status',2)
406 ->field('id,number,create_time,num,shopgoods_id,total') 411 ->field('id,number,create_time,num,shopgoods_id,total')
407 - ->select(); 412 + ->select()
  413 + ->toArray();
408 $data = $this->s_foreach($data); 414 $data = $this->s_foreach($data);
409 $this->success('SUCCESS',$data); 415 $this->success('SUCCESS',$data);
410 }elseif ($status == 2){ 416 }elseif ($status == 2){
411 //已完成的商城订单 417 //已完成的商城订单
412 $data = Db::name('shoporder') 418 $data = Db::name('shoporder')
413 ->where('user_id',$user_id) 419 ->where('user_id',$user_id)
414 - ->where('status',2) 420 + ->where('status',3)
415 ->field('id,number,create_time,num,shopgoods_id,total') 421 ->field('id,number,create_time,num,shopgoods_id,total')
416 - ->select(); 422 + ->select()
  423 + ->toArray();
417 $data = $this->s_foreach($data); 424 $data = $this->s_foreach($data);
418 $this->success('SUCCESS',$data); 425 $this->success('SUCCESS',$data);
419 } 426 }
@@ -675,17 +682,17 @@ class UserController extends RestBaseController @@ -675,17 +682,17 @@ class UserController extends RestBaseController
675 ->find(); 682 ->find();
676 $attr_id = explode(',',$val['order_id']['attr_id']); 683 $attr_id = explode(',',$val['order_id']['attr_id']);
677 684
678 - $val['order_id']['attr_id'] = [];  
679 - foreach ($attr_id as &$v1){  
680 - $v1 = Db::name('attr')  
681 - ->alias('a')  
682 - ->join('rgoods r','a.rgoods_id=r.id')  
683 - ->field('r.rgoods_name')  
684 - ->where('a.id',$v1)  
685 - ->find();  
686 - array_push($val['order_id']['attr_id'],$v1['rgoods_name']);  
687 - }  
688 - $val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']); 685 +// $val['order_id']['attr_id'] = [];
  686 +// foreach ($attr_id as &$v1){
  687 +// $v1 = Db::name('attr')
  688 +// ->alias('a')
  689 +// ->join('rgoods r','a.rgoods_id=r.id')
  690 +// ->field('r.rgoods_name')
  691 +// ->where('a.id',$v1)
  692 +// ->find();
  693 +// array_push($val['order_id']['attr_id'],$v1['rgoods_name']);
  694 +// }
  695 +// $val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']);
689 } 696 }
690 $this->success('success',$list); 697 $this->success('success',$list);
691 698