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

修改统计金额

@@ -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="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$/application/admin/controller/Order.php" afterPath="$PROJECT_DIR$/application/admin/controller/Order.php" /> 5 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" />
6 </list> 6 </list>
7 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> 7 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8 <option name="TRACKING_ENABLED" value="true" /> 8 <option name="TRACKING_ENABLED" value="true" />
@@ -13,93 +13,28 @@ @@ -13,93 +13,28 @@
13 </component> 13 </component>
14 <component name="FileEditorManager"> 14 <component name="FileEditorManager">
15 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> 15 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
16 - <file leaf-file-name="User.php" pinned="false" current-in-tab="false">  
17 - <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">  
18 - <provider selected="true" editor-type-id="text-editor">  
19 - <state relative-caret-position="111">  
20 - <caret line="1826" column="21" lean-forward="false" selection-start-line="1826" selection-start-column="21" selection-end-line="1826" selection-end-column="21" />  
21 - <folding>  
22 - <element signature="e#365#484#0#PHP" expanded="false" />  
23 - <element signature="e#490#1228#0#PHP" expanded="false" />  
24 - <element signature="e#1233#2896#0#PHP" expanded="false" />  
25 - <element signature="e#1266#2890#0#PHP" expanded="false" />  
26 - <element signature="e#2902#3430#0#PHP" expanded="false" />  
27 - <element signature="e#3435#4571#0#PHP" expanded="false" />  
28 - <element signature="e#4577#4984#0#PHP" expanded="false" />  
29 - <element signature="e#4989#5332#0#PHP" expanded="false" />  
30 - <element signature="e#5338#5751#0#PHP" expanded="false" />  
31 - <element signature="e#5756#6104#0#PHP" expanded="false" />  
32 - <element signature="e#6110#6947#0#PHP" expanded="false" />  
33 - <element signature="e#6952#9147#0#PHP" expanded="false" />  
34 - <element signature="e#9153#9833#0#PHP" expanded="false" />  
35 - <element signature="e#9838#10691#0#PHP" expanded="false" />  
36 - <element signature="e#10697#11486#0#PHP" expanded="false" />  
37 - <element signature="e#11491#12839#0#PHP" expanded="false" />  
38 - <element signature="e#12845#13547#0#PHP" expanded="false" />  
39 - <element signature="e#13552#14752#0#PHP" expanded="false" />  
40 - <element signature="e#14758#15334#0#PHP" expanded="false" />  
41 - <element signature="e#15339#15900#0#PHP" expanded="false" />  
42 - <element signature="e#15906#16622#0#PHP" expanded="false" />  
43 - <element signature="e#16627#19053#0#PHP" expanded="false" />  
44 - <element signature="e#19059#19961#0#PHP" expanded="false" />  
45 - <element signature="e#19966#22792#0#PHP" expanded="false" />  
46 - <element signature="e#22798#23175#0#PHP" expanded="false" />  
47 - <element signature="e#23180#23501#0#PHP" expanded="false" />  
48 - <element signature="e#23507#24012#0#PHP" expanded="false" />  
49 - <element signature="e#24017#24268#0#PHP" expanded="false" />  
50 - <element signature="e#24274#24753#0#PHP" expanded="false" />  
51 - <element signature="e#24758#25515#0#PHP" expanded="false" />  
52 - <element signature="e#25521#26002#0#PHP" expanded="false" />  
53 - <element signature="e#26007#26777#0#PHP" expanded="false" />  
54 - <element signature="e#26783#27146#0#PHP" expanded="false" />  
55 - <element signature="e#27151#27342#0#PHP" expanded="false" />  
56 - <element signature="e#27348#27706#0#PHP" expanded="false" />  
57 - <element signature="e#27711#27902#0#PHP" expanded="false" />  
58 - <element signature="e#27908#29051#0#PHP" expanded="false" />  
59 - <element signature="e#29056#31721#0#PHP" expanded="false" />  
60 - <element signature="e#31727#32225#0#PHP" expanded="false" />  
61 - <element signature="e#32230#33976#0#PHP" expanded="false" />  
62 - <element signature="e#33982#34395#0#PHP" expanded="false" />  
63 - <element signature="e#34400#34879#0#PHP" expanded="false" />  
64 - <element signature="e#34885#35419#0#PHP" expanded="false" />  
65 - <element signature="e#35424#36809#0#PHP" expanded="false" />  
66 - <element signature="e#36815#37469#0#PHP" expanded="false" />  
67 - <element signature="e#37474#39489#0#PHP" expanded="false" />  
68 - <element signature="e#39495#40255#0#PHP" expanded="false" />  
69 - <element signature="e#40260#42969#0#PHP" expanded="false" />  
70 - <element signature="e#42995#43826#0#PHP" expanded="false" />  
71 - <element signature="e#43832#44252#0#PHP" expanded="false" />  
72 - <element signature="e#44257#44740#0#PHP" expanded="false" />  
73 - <element signature="e#44746#45552#0#PHP" expanded="false" />  
74 - <element signature="e#45557#48711#0#PHP" expanded="false" />  
75 - <element signature="e#48726#50054#0#PHP" expanded="false" />  
76 - <element signature="e#50070#51097#0#PHP" expanded="false" />  
77 - <element signature="e#51103#51861#0#PHP" expanded="false" />  
78 - <element signature="e#51866#55609#0#PHP" expanded="false" />  
79 - <element signature="e#55615#56007#0#PHP" expanded="false" />  
80 - <element signature="e#56012#56964#0#PHP" expanded="false" />  
81 - <element signature="e#56988#57561#0#PHP" expanded="false" />  
82 - <element signature="e#57567#58166#0#PHP" expanded="false" />  
83 - <element signature="e#58171#59098#0#PHP" expanded="false" />  
84 - <element signature="e#59104#59818#0#PHP" expanded="false" />  
85 - <element signature="e#59824#60251#0#PHP" expanded="false" />  
86 - <element signature="e#60256#60725#0#PHP" expanded="false" />  
87 - <element signature="e#60732#61937#0#PHP" expanded="false" />  
88 - <element signature="e#62089#62428#1#PHP" expanded="false" />  
89 - <element signature="e#62458#62812#1#PHP" expanded="false" />  
90 - </folding>  
91 - </state>  
92 - </provider>  
93 - </entry>  
94 - </file>  
95 - <file leaf-file-name="Order.php" pinned="false" current-in-tab="true">  
96 - <entry file="file://$PROJECT_DIR$/application/admin/controller/Order.php"> 16 + <file leaf-file-name="Pay.php" pinned="false" current-in-tab="true">
  17 + <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
97 <provider selected="true" editor-type-id="text-editor"> 18 <provider selected="true" editor-type-id="text-editor">
98 - <state relative-caret-position="304">  
99 - <caret line="34" column="0" lean-forward="true" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" /> 19 + <state relative-caret-position="368">
  20 + <caret line="713" column="53" lean-forward="true" selection-start-line="713" selection-start-column="53" selection-end-line="713" selection-end-column="53" />
100 <folding> 21 <folding>
101 - <element signature="e#40#74#0#PHP" expanded="true" />  
102 - <element signature="e#955#3141#0#PHP" expanded="false" /> 22 + <element signature="e#699#1012#0#PHP" expanded="false" />
  23 + <element signature="e#1017#3093#0#PHP" expanded="false" />
  24 + <element signature="e#3099#3419#0#PHP" expanded="false" />
  25 + <element signature="e#3424#5506#0#PHP" expanded="false" />
  26 + <element signature="e#5512#5930#0#PHP" expanded="false" />
  27 + <element signature="e#5935#16029#0#PHP" expanded="false" />
  28 + <element signature="e#16035#16455#0#PHP" expanded="false" />
  29 + <element signature="e#16460#26484#0#PHP" expanded="false" />
  30 + <element signature="e#26501#26798#0#PHP" expanded="false" />
  31 + <element signature="e#26803#27196#0#PHP" expanded="false" />
  32 + <element signature="e#27223#30701#0#PHP" expanded="false" />
  33 + <element signature="e#30730#33635#0#PHP" expanded="false" />
  34 + <element signature="e#37558#37945#0#PHP" expanded="false" />
  35 + <element signature="e#38006#38962#0#PHP" expanded="false" />
  36 + <element signature="e#39623#46795#0#PHP" expanded="false" />
  37 + <element signature="e#46818#47035#0#PHP" expanded="false" />
103 </folding> 38 </folding>
104 </state> 39 </state>
105 </provider> 40 </provider>
@@ -172,7 +107,6 @@ @@ -172,7 +107,6 @@
172 <option value="$PROJECT_DIR$/application/admin/lang/zh-cn/video.php" /> 107 <option value="$PROJECT_DIR$/application/admin/lang/zh-cn/video.php" />
173 <option value="$PROJECT_DIR$/public/assets/js/backend/video.js" /> 108 <option value="$PROJECT_DIR$/public/assets/js/backend/video.js" />
174 <option value="$PROJECT_DIR$/runtime/log/201912/07.log" /> 109 <option value="$PROJECT_DIR$/runtime/log/201912/07.log" />
175 - <option value="$PROJECT_DIR$/application/api/controller/Pay.php" />  
176 <option value="$PROJECT_DIR$/application/admin/view/accredit/add.html" /> 110 <option value="$PROJECT_DIR$/application/admin/view/accredit/add.html" />
177 <option value="$PROJECT_DIR$/application/admin/view/pic/edit.html" /> 111 <option value="$PROJECT_DIR$/application/admin/view/pic/edit.html" />
178 <option value="$PROJECT_DIR$/application/admin/view/accredit/edit.html" /> 112 <option value="$PROJECT_DIR$/application/admin/view/accredit/edit.html" />
@@ -183,6 +117,7 @@ @@ -183,6 +117,7 @@
183 <option value="$PROJECT_DIR$/application/admin/view/order/fapiao.html" /> 117 <option value="$PROJECT_DIR$/application/admin/view/order/fapiao.html" />
184 <option value="$PROJECT_DIR$/application/api/controller/User.php" /> 118 <option value="$PROJECT_DIR$/application/api/controller/User.php" />
185 <option value="$PROJECT_DIR$/application/admin/controller/Order.php" /> 119 <option value="$PROJECT_DIR$/application/admin/controller/Order.php" />
  120 + <option value="$PROJECT_DIR$/application/api/controller/Pay.php" />
186 </list> 121 </list>
187 </option> 122 </option>
188 </component> 123 </component>
@@ -200,9 +135,9 @@ @@ -200,9 +135,9 @@
200 <sorting>DEFINITION_ORDER</sorting> 135 <sorting>DEFINITION_ORDER</sorting>
201 </component> 136 </component>
202 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 137 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
203 - <component name="ProjectFrameBounds">  
204 - <option name="x" value="695" />  
205 - <option name="y" value="231" /> 138 + <component name="ProjectFrameBounds" extendedState="7">
  139 + <option name="x" value="369" />
  140 + <option name="y" value="89" />
206 <option name="width" value="1624" /> 141 <option name="width" value="1624" />
207 <option name="height" value="918" /> 142 <option name="height" value="918" />
208 </component> 143 </component>
@@ -238,13 +173,13 @@ @@ -238,13 +173,13 @@
238 <item name="areial" type="b2602c69:ProjectViewProjectNode" /> 173 <item name="areial" type="b2602c69:ProjectViewProjectNode" />
239 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" /> 174 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" />
240 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" /> 175 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
241 - <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" /> 176 + <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
242 </path> 177 </path>
243 <path> 178 <path>
244 <item name="areial" type="b2602c69:ProjectViewProjectNode" /> 179 <item name="areial" type="b2602c69:ProjectViewProjectNode" />
245 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" /> 180 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" />
246 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" /> 181 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
247 - <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" /> 182 + <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
248 <item name="controller" type="2a2b976b:PhpTreeStructureProvider$1" /> 183 <item name="controller" type="2a2b976b:PhpTreeStructureProvider$1" />
249 </path> 184 </path>
250 </expand> 185 </expand>
@@ -339,7 +274,7 @@ @@ -339,7 +274,7 @@
339 <workItem from="1575773423431" duration="694000" /> 274 <workItem from="1575773423431" duration="694000" />
340 <workItem from="1575776183372" duration="2267000" /> 275 <workItem from="1575776183372" duration="2267000" />
341 <workItem from="1575790089275" duration="377000" /> 276 <workItem from="1575790089275" duration="377000" />
342 - <workItem from="1575851041026" duration="12832000" /> 277 + <workItem from="1575851041026" duration="13593000" />
343 </task> 278 </task>
344 <task id="LOCAL-00001" summary="调试"> 279 <task id="LOCAL-00001" summary="调试">
345 <created>1574145133364</created> 280 <created>1574145133364</created>
@@ -352,7 +287,7 @@ @@ -352,7 +287,7 @@
352 <servers /> 287 <servers />
353 </component> 288 </component>
354 <component name="TimeTrackingManager"> 289 <component name="TimeTrackingManager">
355 - <option name="totallyTimeSpent" value="353299000" /> 290 + <option name="totallyTimeSpent" value="354060000" />
356 </component> 291 </component>
357 <component name="TodoView"> 292 <component name="TodoView">
358 <todo-panel id="selected-file"> 293 <todo-panel id="selected-file">
@@ -364,10 +299,10 @@ @@ -364,10 +299,10 @@
364 </todo-panel> 299 </todo-panel>
365 </component> 300 </component>
366 <component name="ToolWindowManager"> 301 <component name="ToolWindowManager">
367 - <frame x="695" y="231" width="1624" height="918" extended-state="0" /> 302 + <frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
368 <editor active="true" /> 303 <editor active="true" />
369 <layout> 304 <layout>
370 - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1528133" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> 305 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12739871" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
371 <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" /> 306 <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" />
372 <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" /> 307 <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" />
373 <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" /> 308 <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" />
@@ -639,13 +574,6 @@ @@ -639,13 +574,6 @@
639 </state> 574 </state>
640 </provider> 575 </provider>
641 </entry> 576 </entry>
642 - <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">  
643 - <provider selected="true" editor-type-id="text-editor">  
644 - <state relative-caret-position="25">  
645 - <caret line="786" column="40" lean-forward="true" selection-start-line="786" selection-start-column="40" selection-end-line="786" selection-end-column="40" />  
646 - </state>  
647 - </provider>  
648 - </entry>  
649 <entry file="file://$PROJECT_DIR$/application/admin/view/dashboard/index.html"> 577 <entry file="file://$PROJECT_DIR$/application/admin/view/dashboard/index.html">
650 <provider selected="true" editor-type-id="text-editor"> 578 <provider selected="true" editor-type-id="text-editor">
651 <state relative-caret-position="75"> 579 <state relative-caret-position="75">
@@ -781,6 +709,17 @@ @@ -781,6 +709,17 @@
781 </state> 709 </state>
782 </provider> 710 </provider>
783 </entry> 711 </entry>
  712 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Order.php">
  713 + <provider selected="true" editor-type-id="text-editor">
  714 + <state relative-caret-position="54">
  715 + <caret line="24" column="50" lean-forward="true" selection-start-line="24" selection-start-column="50" selection-end-line="24" selection-end-column="50" />
  716 + <folding>
  717 + <element signature="e#40#74#0#PHP" expanded="true" />
  718 + <element signature="e#955#3141#0#PHP" expanded="false" />
  719 + </folding>
  720 + </state>
  721 + </provider>
  722 + </entry>
784 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> 723 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
785 <provider selected="true" editor-type-id="text-editor"> 724 <provider selected="true" editor-type-id="text-editor">
786 <state relative-caret-position="111"> 725 <state relative-caret-position="111">
@@ -858,13 +797,27 @@ @@ -858,13 +797,27 @@
858 </state> 797 </state>
859 </provider> 798 </provider>
860 </entry> 799 </entry>
861 - <entry file="file://$PROJECT_DIR$/application/admin/controller/Order.php"> 800 + <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
862 <provider selected="true" editor-type-id="text-editor"> 801 <provider selected="true" editor-type-id="text-editor">
863 - <state relative-caret-position="304">  
864 - <caret line="34" column="0" lean-forward="true" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" /> 802 + <state relative-caret-position="368">
  803 + <caret line="713" column="53" lean-forward="true" selection-start-line="713" selection-start-column="53" selection-end-line="713" selection-end-column="53" />
865 <folding> 804 <folding>
866 - <element signature="e#40#74#0#PHP" expanded="true" />  
867 - <element signature="e#955#3141#0#PHP" expanded="false" /> 805 + <element signature="e#699#1012#0#PHP" expanded="false" />
  806 + <element signature="e#1017#3093#0#PHP" expanded="false" />
  807 + <element signature="e#3099#3419#0#PHP" expanded="false" />
  808 + <element signature="e#3424#5506#0#PHP" expanded="false" />
  809 + <element signature="e#5512#5930#0#PHP" expanded="false" />
  810 + <element signature="e#5935#16029#0#PHP" expanded="false" />
  811 + <element signature="e#16035#16455#0#PHP" expanded="false" />
  812 + <element signature="e#16460#26484#0#PHP" expanded="false" />
  813 + <element signature="e#26501#26798#0#PHP" expanded="false" />
  814 + <element signature="e#26803#27196#0#PHP" expanded="false" />
  815 + <element signature="e#27223#30701#0#PHP" expanded="false" />
  816 + <element signature="e#30730#33635#0#PHP" expanded="false" />
  817 + <element signature="e#37558#37945#0#PHP" expanded="false" />
  818 + <element signature="e#38006#38962#0#PHP" expanded="false" />
  819 + <element signature="e#39623#46795#0#PHP" expanded="false" />
  820 + <element signature="e#46818#47035#0#PHP" expanded="false" />
868 </folding> 821 </folding>
869 </state> 822 </state>
870 </provider> 823 </provider>
@@ -708,23 +708,18 @@ class Pay extends Api @@ -708,23 +708,18 @@ class Pay extends Api
708 if(!empty($pic_id)){ 708 if(!empty($pic_id)){
709 //将购买次数加1 709 //将购买次数加1
710 foreach ($pic_id as $key => $v){ 710 foreach ($pic_id as $key => $v){
  711 + $pic = Db::name('pic')->field('id,title,url,code,price,buy_num,money')->where('id',$v)->find();
  712 + $str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],";
711 //非会员 713 //非会员
712 if($user['is_vip'] == 0){ 714 if($user['is_vip'] == 0){
713 - $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();  
714 $total_money = $pic['money']+$pic['price']; 715 $total_money = $pic['money']+$pic['price'];
715 Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]); 716 Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]);
716 }else{ 717 }else{
717 //是会员 718 //是会员
718 - $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();  
719 $total_money = $pic['money'] + ($pic['price']*0.75); 719 $total_money = $pic['money'] + ($pic['price']*0.75);
720 Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]); 720 Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]);
721 } 721 }
722 } 722 }
723 - //拼接发送短信的内容  
724 - foreach ($pic_id as $key => $v){  
725 - $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();  
726 - $str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],";  
727 - }  
728 } 723 }
729 //视频 724 //视频
730 if(!empty($video_id)){ 725 if(!empty($video_id)){