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

修改微信支付以后订单总金额

@@ -2,9 +2,7 @@ @@ -2,9 +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/lang/zh-cn/pic.php" afterPath="$PROJECT_DIR$/application/admin/lang/zh-cn/pic.php" />  
6 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" /> 5 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" />
7 - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/assets/js/backend/pic.js" afterPath="$PROJECT_DIR$/public/assets/js/backend/pic.js" />  
8 </list> 6 </list>
9 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> 7 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
10 <option name="TRACKING_ENABLED" value="true" /> 8 <option name="TRACKING_ENABLED" value="true" />
@@ -90,8 +88,8 @@ @@ -90,8 +88,8 @@
90 <file leaf-file-name="Pay.php" pinned="false" current-in-tab="true"> 88 <file leaf-file-name="Pay.php" pinned="false" current-in-tab="true">
91 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php"> 89 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
92 <provider selected="true" editor-type-id="text-editor"> 90 <provider selected="true" editor-type-id="text-editor">
93 - <state relative-caret-position="96">  
94 - <caret line="370" column="37" lean-forward="false" selection-start-line="370" selection-start-column="37" selection-end-line="370" selection-end-column="37" /> 91 + <state relative-caret-position="159">
  92 + <caret line="742" column="40" lean-forward="true" selection-start-line="742" selection-start-column="40" selection-end-line="742" selection-end-column="40" />
95 <folding> 93 <folding>
96 <element signature="e#574#693#0#PHP" expanded="false" /> 94 <element signature="e#574#693#0#PHP" expanded="false" />
97 <element signature="e#699#1012#0#PHP" expanded="false" /> 95 <element signature="e#699#1012#0#PHP" expanded="false" />
@@ -99,17 +97,18 @@ @@ -99,17 +97,18 @@
99 <element signature="e#3099#3419#0#PHP" expanded="false" /> 97 <element signature="e#3099#3419#0#PHP" expanded="false" />
100 <element signature="e#3424#5506#0#PHP" expanded="false" /> 98 <element signature="e#3424#5506#0#PHP" expanded="false" />
101 <element signature="e#5512#5930#0#PHP" expanded="false" /> 99 <element signature="e#5512#5930#0#PHP" expanded="false" />
  100 + <element signature="e#5935#14097#0#PHP" expanded="false" />
102 <element signature="e#6179#6269#0#PHP" expanded="false" /> 101 <element signature="e#6179#6269#0#PHP" expanded="false" />
103 <element signature="e#6347#6443#0#PHP" expanded="false" /> 102 <element signature="e#6347#6443#0#PHP" expanded="false" />
104 <element signature="e#12255#14030#0#PHP" expanded="false" /> 103 <element signature="e#12255#14030#0#PHP" expanded="false" />
105 <element signature="e#14103#14523#0#PHP" expanded="false" /> 104 <element signature="e#14103#14523#0#PHP" expanded="false" />
  105 + <element signature="e#14528#22620#0#PHP" expanded="false" />
106 <element signature="e#22637#22934#0#PHP" expanded="false" /> 106 <element signature="e#22637#22934#0#PHP" expanded="false" />
107 <element signature="e#22939#23332#0#PHP" expanded="false" /> 107 <element signature="e#22939#23332#0#PHP" expanded="false" />
108 <element signature="e#23359#26837#0#PHP" expanded="false" /> 108 <element signature="e#23359#26837#0#PHP" expanded="false" />
109 <element signature="e#26866#29771#0#PHP" expanded="false" /> 109 <element signature="e#26866#29771#0#PHP" expanded="false" />
110 - <element signature="e#29800#33250#0#PHP" expanded="false" />  
111 - <element signature="e#33279#37016#0#PHP" expanded="false" />  
112 - <element signature="e#37039#37256#0#PHP" expanded="false" /> 110 + <element signature="e#29800#33976#0#PHP" expanded="false" />
  111 + <element signature="e#38491#38708#0#PHP" expanded="false" />
113 </folding> 112 </folding>
114 </state> 113 </state>
115 </provider> 114 </provider>
@@ -201,9 +200,9 @@ @@ -201,9 +200,9 @@
201 <sorting>DEFINITION_ORDER</sorting> 200 <sorting>DEFINITION_ORDER</sorting>
202 </component> 201 </component>
203 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 202 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
204 - <component name="ProjectFrameBounds" extendedState="7">  
205 - <option name="x" value="204" />  
206 - <option name="y" value="166" /> 203 + <component name="ProjectFrameBounds" extendedState="1">
  204 + <option name="x" value="11" />
  205 + <option name="y" value="22" />
207 <option name="width" value="1700" /> 206 <option name="width" value="1700" />
208 <option name="height" value="1000" /> 207 <option name="height" value="1000" />
209 </component> 208 </component>
@@ -333,7 +332,7 @@ @@ -333,7 +332,7 @@
333 <workItem from="1575541798312" duration="2359000" /> 332 <workItem from="1575541798312" duration="2359000" />
334 <workItem from="1575592025964" duration="640000" /> 333 <workItem from="1575592025964" duration="640000" />
335 <workItem from="1575599624364" duration="95000" /> 334 <workItem from="1575599624364" duration="95000" />
336 - <workItem from="1575680867057" duration="8140000" /> 335 + <workItem from="1575680867057" duration="8789000" />
337 </task> 336 </task>
338 <task id="LOCAL-00001" summary="调试"> 337 <task id="LOCAL-00001" summary="调试">
339 <created>1574145133364</created> 338 <created>1574145133364</created>
@@ -346,7 +345,7 @@ @@ -346,7 +345,7 @@
346 <servers /> 345 <servers />
347 </component> 346 </component>
348 <component name="TimeTrackingManager"> 347 <component name="TimeTrackingManager">
349 - <option name="totallyTimeSpent" value="318039000" /> 348 + <option name="totallyTimeSpent" value="318688000" />
350 </component> 349 </component>
351 <component name="TodoView"> 350 <component name="TodoView">
352 <todo-panel id="selected-file"> 351 <todo-panel id="selected-file">
@@ -358,16 +357,16 @@ @@ -358,16 +357,16 @@
358 </todo-panel> 357 </todo-panel>
359 </component> 358 </component>
360 <component name="ToolWindowManager"> 359 <component name="ToolWindowManager">
361 - <frame x="-8" y="-8" width="1936" height="1056" extended-state="7" /> 360 + <frame x="11" y="22" width="1700" height="1000" extended-state="1" />
362 <layout> 361 <layout>
363 - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1705757" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> 362 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19512194" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
364 <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" /> 363 <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" />
365 <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" /> 364 <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" />
366 <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" /> 365 <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" />
367 <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="5" side_tool="false" content_ui="tabs" /> 366 <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="5" side_tool="false" content_ui="tabs" />
368 <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="1" side_tool="false" content_ui="tabs" /> 367 <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="1" side_tool="false" content_ui="tabs" />
369 <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="2" side_tool="false" content_ui="tabs" /> 368 <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="2" side_tool="false" content_ui="tabs" />
370 - <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.09793253" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> 369 + <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.09733488" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
371 <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="6" side_tool="false" content_ui="tabs" /> 370 <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="6" side_tool="false" content_ui="tabs" />
372 <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="0" side_tool="true" content_ui="tabs" /> 371 <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="0" side_tool="true" content_ui="tabs" />
373 <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="7" side_tool="false" content_ui="tabs" /> 372 <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="7" side_tool="false" content_ui="tabs" />
@@ -854,8 +853,8 @@ @@ -854,8 +853,8 @@
854 </entry> 853 </entry>
855 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php"> 854 <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
856 <provider selected="true" editor-type-id="text-editor"> 855 <provider selected="true" editor-type-id="text-editor">
857 - <state relative-caret-position="96">  
858 - <caret line="370" column="37" lean-forward="false" selection-start-line="370" selection-start-column="37" selection-end-line="370" selection-end-column="37" /> 856 + <state relative-caret-position="159">
  857 + <caret line="742" column="40" lean-forward="true" selection-start-line="742" selection-start-column="40" selection-end-line="742" selection-end-column="40" />
859 <folding> 858 <folding>
860 <element signature="e#574#693#0#PHP" expanded="false" /> 859 <element signature="e#574#693#0#PHP" expanded="false" />
861 <element signature="e#699#1012#0#PHP" expanded="false" /> 860 <element signature="e#699#1012#0#PHP" expanded="false" />
@@ -863,17 +862,18 @@ @@ -863,17 +862,18 @@
863 <element signature="e#3099#3419#0#PHP" expanded="false" /> 862 <element signature="e#3099#3419#0#PHP" expanded="false" />
864 <element signature="e#3424#5506#0#PHP" expanded="false" /> 863 <element signature="e#3424#5506#0#PHP" expanded="false" />
865 <element signature="e#5512#5930#0#PHP" expanded="false" /> 864 <element signature="e#5512#5930#0#PHP" expanded="false" />
  865 + <element signature="e#5935#14097#0#PHP" expanded="false" />
866 <element signature="e#6179#6269#0#PHP" expanded="false" /> 866 <element signature="e#6179#6269#0#PHP" expanded="false" />
867 <element signature="e#6347#6443#0#PHP" expanded="false" /> 867 <element signature="e#6347#6443#0#PHP" expanded="false" />
868 <element signature="e#12255#14030#0#PHP" expanded="false" /> 868 <element signature="e#12255#14030#0#PHP" expanded="false" />
869 <element signature="e#14103#14523#0#PHP" expanded="false" /> 869 <element signature="e#14103#14523#0#PHP" expanded="false" />
  870 + <element signature="e#14528#22620#0#PHP" expanded="false" />
870 <element signature="e#22637#22934#0#PHP" expanded="false" /> 871 <element signature="e#22637#22934#0#PHP" expanded="false" />
871 <element signature="e#22939#23332#0#PHP" expanded="false" /> 872 <element signature="e#22939#23332#0#PHP" expanded="false" />
872 <element signature="e#23359#26837#0#PHP" expanded="false" /> 873 <element signature="e#23359#26837#0#PHP" expanded="false" />
873 <element signature="e#26866#29771#0#PHP" expanded="false" /> 874 <element signature="e#26866#29771#0#PHP" expanded="false" />
874 - <element signature="e#29800#33250#0#PHP" expanded="false" />  
875 - <element signature="e#33279#37016#0#PHP" expanded="false" />  
876 - <element signature="e#37039#37256#0#PHP" expanded="false" /> 875 + <element signature="e#29800#33976#0#PHP" expanded="false" />
  876 + <element signature="e#38491#38708#0#PHP" expanded="false" />
877 </folding> 877 </folding>
878 </state> 878 </state>
879 </provider> 879 </provider>
@@ -651,10 +651,24 @@ class Pay extends Api @@ -651,10 +651,24 @@ class Pay extends Api
651 $user = Db::name('user')->where('id',$data['user_id'])->find(); 651 $user = Db::name('user')->where('id',$data['user_id'])->find();
652 $mobile = $user['mobile']; 652 $mobile = $user['mobile'];
653 $str = "【仁甲看见】"; 653 $str = "【仁甲看见】";
  654 +
  655 + //判断用户是否为会员
  656 + $login = Db::name('user')
  657 + ->where('id',$data['user_id'])
  658 + ->field('id,is_vip')
  659 + ->find();
  660 +
654 if(!empty($pic_id)){ 661 if(!empty($pic_id)){
655 foreach ($pic_id as $key => $v){ 662 foreach ($pic_id as $key => $v){
656 - $pic = Db::name('pic')->field('id,buy_num')->where('id',$v)->find();  
657 - Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1]); 663 + //非会员
  664 + if($login['is_vip'] == 0){
  665 + $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
  666 + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
  667 + }else{
  668 + //是会员
  669 + $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
  670 + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
  671 + }
658 } 672 }
659 foreach ($pic_id as $key => $v){ 673 foreach ($pic_id as $key => $v){
660 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find(); 674 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();
@@ -719,10 +733,24 @@ class Pay extends Api @@ -719,10 +733,24 @@ class Pay extends Api
719 $user = Db::name('user')->where('id',$data['user_id'])->find(); 733 $user = Db::name('user')->where('id',$data['user_id'])->find();
720 $mobile = $user['mobile']; 734 $mobile = $user['mobile'];
721 $str = "【仁甲看见】"; 735 $str = "【仁甲看见】";
  736 +
  737 + //判断用户是否为会员
  738 + $login = Db::name('user')
  739 + ->where('id',$data['user_id'])
  740 + ->field('id,is_vip')
  741 + ->find();
  742 +
722 if(!empty($pic_id)){ 743 if(!empty($pic_id)){
723 foreach ($pic_id as $key => $v){ 744 foreach ($pic_id as $key => $v){
724 - $pic = Db::name('pic')->field('id,buy_num')->where('id',$v)->find();  
725 - Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1]); 745 + //非会员
  746 + if($login['is_vip'] == 0){
  747 + $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
  748 + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
  749 + }else{
  750 + //是会员
  751 + $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
  752 + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
  753 + }
726 } 754 }
727 foreach ($pic_id as $key => $v){ 755 foreach ($pic_id as $key => $v){
728 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find(); 756 $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();