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

修改订单

@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <project version="4"> 2 <project version="4">
3 <component name="ChangeListManager"> 3 <component name="ChangeListManager">
4 <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment=""> 4 <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" 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$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" /> 6 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" />
6 </list> 7 </list>
7 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> 8 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -16,8 +17,8 @@ @@ -16,8 +17,8 @@
16 <file leaf-file-name="User.php" pinned="false" current-in-tab="false"> 17 <file leaf-file-name="User.php" pinned="false" current-in-tab="false">
17 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> 18 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
18 <provider selected="true" editor-type-id="text-editor"> 19 <provider selected="true" editor-type-id="text-editor">
19 - <state relative-caret-position="100">  
20 - <caret line="774" column="5" lean-forward="true" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> 20 + <state relative-caret-position="2100">
  21 + <caret line="774" column="5" lean-forward="false" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" />
21 <folding> 22 <folding>
22 <element signature="e#1233#2896#0#PHP" expanded="false" /> 23 <element signature="e#1233#2896#0#PHP" expanded="false" />
23 <element signature="e#2902#3430#0#PHP" expanded="false" /> 24 <element signature="e#2902#3430#0#PHP" expanded="false" />
@@ -89,8 +90,8 @@ @@ -89,8 +90,8 @@
89 <file leaf-file-name="Pay.php" pinned="false" current-in-tab="true"> 90 <file leaf-file-name="Pay.php" pinned="false" current-in-tab="true">
90 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php"> 91 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
91 <provider selected="true" editor-type-id="text-editor"> 92 <provider selected="true" editor-type-id="text-editor">
92 - <state relative-caret-position="210">  
93 - <caret line="729" column="21" lean-forward="true" selection-start-line="729" selection-start-column="21" selection-end-line="729" selection-end-column="21" /> 93 + <state relative-caret-position="194">
  94 + <caret line="789" column="26" lean-forward="true" selection-start-line="789" selection-start-column="26" selection-end-line="789" selection-end-column="26" />
94 <folding> 95 <folding>
95 <element signature="e#574#693#0#PHP" expanded="false" /> 96 <element signature="e#574#693#0#PHP" expanded="false" />
96 <element signature="e#699#1012#0#PHP" expanded="false" /> 97 <element signature="e#699#1012#0#PHP" expanded="false" />
@@ -100,9 +101,9 @@ @@ -100,9 +101,9 @@
100 <element signature="e#5512#5930#0#PHP" expanded="false" /> 101 <element signature="e#5512#5930#0#PHP" expanded="false" />
101 <element signature="e#6179#6269#0#PHP" expanded="false" /> 102 <element signature="e#6179#6269#0#PHP" expanded="false" />
102 <element signature="e#6347#6443#0#PHP" expanded="false" /> 103 <element signature="e#6347#6443#0#PHP" expanded="false" />
103 - <element signature="e#7772#9181#0#PHP" expanded="false" />  
104 <element signature="e#11546#11997#0#PHP" expanded="false" /> 104 <element signature="e#11546#11997#0#PHP" expanded="false" />
105 <element signature="e#13212#13330#0#PHP" expanded="false" /> 105 <element signature="e#13212#13330#0#PHP" expanded="false" />
  106 + <element signature="e#14187#15962#0#PHP" expanded="false" />
106 <element signature="e#16035#16455#0#PHP" expanded="false" /> 107 <element signature="e#16035#16455#0#PHP" expanded="false" />
107 <element signature="e#16460#26484#0#PHP" expanded="false" /> 108 <element signature="e#16460#26484#0#PHP" expanded="false" />
108 <element signature="e#18227#19634#0#PHP" expanded="false" /> 109 <element signature="e#18227#19634#0#PHP" expanded="false" />
@@ -113,10 +114,11 @@ @@ -113,10 +114,11 @@
113 <element signature="e#26803#27196#0#PHP" expanded="false" /> 114 <element signature="e#26803#27196#0#PHP" expanded="false" />
114 <element signature="e#27223#30701#0#PHP" expanded="false" /> 115 <element signature="e#27223#30701#0#PHP" expanded="false" />
115 <element signature="e#30730#33635#0#PHP" expanded="false" /> 116 <element signature="e#30730#33635#0#PHP" expanded="false" />
116 - <element signature="e#34685#35992#0#PHP" expanded="false" />  
117 - <element signature="e#36013#39569#0#PHP" expanded="false" />  
118 - <element signature="e#38093#38480#0#PHP" expanded="false" />  
119 - <element signature="e#40209#47381#0#PHP" expanded="false" /> 117 + <element signature="e#34478#35794#0#PHP" expanded="false" />
  118 + <element signature="e#35815#39319#0#PHP" expanded="false" />
  119 + <element signature="e#37893#38280#0#PHP" expanded="false" />
  120 + <element signature="e#38341#39297#0#PHP" expanded="false" />
  121 + <element signature="e#39958#47130#0#PHP" expanded="false" />
120 </folding> 122 </folding>
121 </state> 123 </state>
122 </provider> 124 </provider>
@@ -209,11 +211,11 @@ @@ -209,11 +211,11 @@
209 <sorting>DEFINITION_ORDER</sorting> 211 <sorting>DEFINITION_ORDER</sorting>
210 </component> 212 </component>
211 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 213 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
212 - <component name="ProjectFrameBounds">  
213 - <option name="x" value="348" />  
214 - <option name="y" value="38" /> 214 + <component name="ProjectFrameBounds" extendedState="1">
  215 + <option name="x" value="2" />
  216 + <option name="y" value="11" />
215 <option name="width" value="1871" /> 217 <option name="width" value="1871" />
216 - <option name="height" value="997" /> 218 + <option name="height" value="996" />
217 </component> 219 </component>
218 <component name="ProjectView"> 220 <component name="ProjectView">
219 <navigator currentView="ProjectPane" proportions="" version="1"> 221 <navigator currentView="ProjectPane" proportions="" version="1">
@@ -230,6 +232,7 @@ @@ -230,6 +232,7 @@
230 <foldersAlwaysOnTop value="true" /> 232 <foldersAlwaysOnTop value="true" />
231 </navigator> 233 </navigator>
232 <panes> 234 <panes>
  235 + <pane id="Scope" />
233 <pane id="Scratches" /> 236 <pane id="Scratches" />
234 <pane id="ProjectPane"> 237 <pane id="ProjectPane">
235 <subPane> 238 <subPane>
@@ -285,7 +288,6 @@ @@ -285,7 +288,6 @@
285 <select /> 288 <select />
286 </subPane> 289 </subPane>
287 </pane> 290 </pane>
288 - <pane id="Scope" />  
289 </panes> 291 </panes>
290 </component> 292 </component>
291 <component name="PropertiesComponent"> 293 <component name="PropertiesComponent">
@@ -367,7 +369,8 @@ @@ -367,7 +369,8 @@
367 <workItem from="1575592025964" duration="640000" /> 369 <workItem from="1575592025964" duration="640000" />
368 <workItem from="1575599624364" duration="95000" /> 370 <workItem from="1575599624364" duration="95000" />
369 <workItem from="1575680867057" duration="23412000" /> 371 <workItem from="1575680867057" duration="23412000" />
370 - <workItem from="1575708184460" duration="1675000" /> 372 + <workItem from="1575708184460" duration="1768000" />
  373 + <workItem from="1575771325770" duration="637000" />
371 </task> 374 </task>
372 <task id="LOCAL-00001" summary="调试"> 375 <task id="LOCAL-00001" summary="调试">
373 <created>1574145133364</created> 376 <created>1574145133364</created>
@@ -380,7 +383,7 @@ @@ -380,7 +383,7 @@
380 <servers /> 383 <servers />
381 </component> 384 </component>
382 <component name="TimeTrackingManager"> 385 <component name="TimeTrackingManager">
383 - <option name="totallyTimeSpent" value="334986000" /> 386 + <option name="totallyTimeSpent" value="335716000" />
384 </component> 387 </component>
385 <component name="TodoView"> 388 <component name="TodoView">
386 <todo-panel id="selected-file"> 389 <todo-panel id="selected-file">
@@ -392,10 +395,10 @@ @@ -392,10 +395,10 @@
392 </todo-panel> 395 </todo-panel>
393 </component> 396 </component>
394 <component name="ToolWindowManager"> 397 <component name="ToolWindowManager">
395 - <frame x="348" y="38" width="1871" height="997" extended-state="0" /> 398 + <frame x="2" y="11" width="1871" height="996" extended-state="1" />
396 <editor active="true" /> 399 <editor active="true" />
397 <layout> 400 <layout>
398 - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1722805" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> 401 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17393705" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
399 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> 402 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
400 <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="0" side_tool="true" content_ui="tabs" /> 403 <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="0" side_tool="true" content_ui="tabs" />
401 <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="0" side_tool="false" content_ui="tabs" /> 404 <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="0" side_tool="false" content_ui="tabs" />
@@ -790,8 +793,8 @@ @@ -790,8 +793,8 @@
790 </entry> 793 </entry>
791 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> 794 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
792 <provider selected="true" editor-type-id="text-editor"> 795 <provider selected="true" editor-type-id="text-editor">
793 - <state relative-caret-position="100">  
794 - <caret line="774" column="5" lean-forward="true" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> 796 + <state relative-caret-position="2100">
  797 + <caret line="774" column="5" lean-forward="false" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" />
795 <folding> 798 <folding>
796 <element signature="e#1233#2896#0#PHP" expanded="false" /> 799 <element signature="e#1233#2896#0#PHP" expanded="false" />
797 <element signature="e#2902#3430#0#PHP" expanded="false" /> 800 <element signature="e#2902#3430#0#PHP" expanded="false" />
@@ -861,8 +864,8 @@ @@ -861,8 +864,8 @@
861 </entry> 864 </entry>
862 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php"> 865 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
863 <provider selected="true" editor-type-id="text-editor"> 866 <provider selected="true" editor-type-id="text-editor">
864 - <state relative-caret-position="210">  
865 - <caret line="729" column="21" lean-forward="true" selection-start-line="729" selection-start-column="21" selection-end-line="729" selection-end-column="21" /> 867 + <state relative-caret-position="194">
  868 + <caret line="789" column="26" lean-forward="true" selection-start-line="789" selection-start-column="26" selection-end-line="789" selection-end-column="26" />
866 <folding> 869 <folding>
867 <element signature="e#574#693#0#PHP" expanded="false" /> 870 <element signature="e#574#693#0#PHP" expanded="false" />
868 <element signature="e#699#1012#0#PHP" expanded="false" /> 871 <element signature="e#699#1012#0#PHP" expanded="false" />
@@ -872,9 +875,9 @@ @@ -872,9 +875,9 @@
872 <element signature="e#5512#5930#0#PHP" expanded="false" /> 875 <element signature="e#5512#5930#0#PHP" expanded="false" />
873 <element signature="e#6179#6269#0#PHP" expanded="false" /> 876 <element signature="e#6179#6269#0#PHP" expanded="false" />
874 <element signature="e#6347#6443#0#PHP" expanded="false" /> 877 <element signature="e#6347#6443#0#PHP" expanded="false" />
875 - <element signature="e#7772#9181#0#PHP" expanded="false" />  
876 <element signature="e#11546#11997#0#PHP" expanded="false" /> 878 <element signature="e#11546#11997#0#PHP" expanded="false" />
877 <element signature="e#13212#13330#0#PHP" expanded="false" /> 879 <element signature="e#13212#13330#0#PHP" expanded="false" />
  880 + <element signature="e#14187#15962#0#PHP" expanded="false" />
878 <element signature="e#16035#16455#0#PHP" expanded="false" /> 881 <element signature="e#16035#16455#0#PHP" expanded="false" />
879 <element signature="e#16460#26484#0#PHP" expanded="false" /> 882 <element signature="e#16460#26484#0#PHP" expanded="false" />
880 <element signature="e#18227#19634#0#PHP" expanded="false" /> 883 <element signature="e#18227#19634#0#PHP" expanded="false" />
@@ -885,10 +888,11 @@ @@ -885,10 +888,11 @@
885 <element signature="e#26803#27196#0#PHP" expanded="false" /> 888 <element signature="e#26803#27196#0#PHP" expanded="false" />
886 <element signature="e#27223#30701#0#PHP" expanded="false" /> 889 <element signature="e#27223#30701#0#PHP" expanded="false" />
887 <element signature="e#30730#33635#0#PHP" expanded="false" /> 890 <element signature="e#30730#33635#0#PHP" expanded="false" />
888 - <element signature="e#34685#35992#0#PHP" expanded="false" />  
889 - <element signature="e#36013#39569#0#PHP" expanded="false" />  
890 - <element signature="e#38093#38480#0#PHP" expanded="false" />  
891 - <element signature="e#40209#47381#0#PHP" expanded="false" /> 891 + <element signature="e#34478#35794#0#PHP" expanded="false" />
  892 + <element signature="e#35815#39319#0#PHP" expanded="false" />
  893 + <element signature="e#37893#38280#0#PHP" expanded="false" />
  894 + <element signature="e#38341#39297#0#PHP" expanded="false" />
  895 + <element signature="e#39958#47130#0#PHP" expanded="false" />
892 </folding> 896 </folding>
893 </state> 897 </state>
894 </provider> 898 </provider>
@@ -702,18 +702,14 @@ class Pay extends Api @@ -702,18 +702,14 @@ class Pay extends Api
702 $user = Db::name('user')->where('id',$data['user_id'])->find(); 702 $user = Db::name('user')->where('id',$data['user_id'])->find();
703 $mobile = $user['mobile']; 703 $mobile = $user['mobile'];
704 $str = "【仁甲看见】"; 704 $str = "【仁甲看见】";
705 - $uid = $this->uid;  
706 - $login = Db::name('user')  
707 - ->where('id',$uid)  
708 - ->field('id,is_vip')  
709 - ->find();  
710 - if(!empty($pic_id)){ 705 + if(empty($pic_id)){
711 //将购买次数加1 706 //将购买次数加1
712 foreach ($pic_id as $key => $v){ 707 foreach ($pic_id as $key => $v){
713 //非会员 708 //非会员
714 - if($login['is_vip'] == 0){ 709 + if($user['is_vip'] == 0){
715 $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find(); 710 $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
716 - Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]); 711 + $total_money = $pic['money']+$pic['price'];
  712 + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]);
717 }else{ 713 }else{
718 //是会员 714 //是会员
719 $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find(); 715 $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
@@ -726,11 +722,10 @@ class Pay extends Api @@ -726,11 +722,10 @@ class Pay extends Api
726 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find(); 722 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();
727 $str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],"; 723 $str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],";
728 } 724 }
729 - $toporder['status'] = 30;  
730 } 725 }
731 - if(!empty($video_id)){ 726 + if(empty($video_id)){
732 //判断是否为会员 727 //判断是否为会员
733 - if($login['is_vip'] == 0){ 728 + if($user['is_vip'] == 0){
734 //不是会员的情况 729 //不是会员的情况
735 //将购买次数加1 730 //将购买次数加1
736 foreach ($video_id as $key => $val){ 731 foreach ($video_id as $key => $val){
@@ -783,14 +778,13 @@ class Pay extends Api @@ -783,14 +778,13 @@ class Pay extends Api
783 $str .= "视频标题:$video[title],云盘地址:$video[eight_url],提取码:$video[eight_code]"; 778 $str .= "视频标题:$video[title],云盘地址:$video[eight_url],提取码:$video[eight_code]";
784 } 779 }
785 } 780 }
786 - $toporder['status'] = 40;  
787 } 781 }
788 //发送短信 782 //发送短信
789 if(!empty($mobile)){ 783 if(!empty($mobile)){
790 $result = $this->sms($mobile,$str); 784 $result = $this->sms($mobile,$str);
791 } 785 }
792 //支付成功,更新订单状态 786 //支付成功,更新订单状态
793 - $toporder['status'] = 20; 787 + $toporder['status'] = 2;
794 $toporder['paytime'] = time(); 788 $toporder['paytime'] = time();
795 }else{ 789 }else{
796 //支付失败 790 //支付失败