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

修改支付

@@ -25,81 +25,47 @@ @@ -25,81 +25,47 @@
25 </component> 25 </component>
26 <component name="FileEditorManager"> 26 <component name="FileEditorManager">
27 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> 27 <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
28 - <file leaf-file-name="OrderController.php" pinned="false" current-in-tab="false"> 28 + <file leaf-file-name="OrderController.php" pinned="false" current-in-tab="true">
29 <entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php"> 29 <entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
30 <provider selected="true" editor-type-id="text-editor"> 30 <provider selected="true" editor-type-id="text-editor">
31 - <state relative-caret-position="166">  
32 - <caret line="109" column="24" lean-forward="false" selection-start-line="109" selection-start-column="24" selection-end-line="109" selection-end-column="24" /> 31 + <state relative-caret-position="286">
  32 + <caret line="157" column="41" lean-forward="true" selection-start-line="157" selection-start-column="41" selection-end-line="157" selection-end-column="41" />
33 <folding> 33 <folding>
34 <element signature="e#131#162#0#PHP" expanded="true" /> 34 <element signature="e#131#162#0#PHP" expanded="true" />
35 <element signature="e#336#608#0#PHP" expanded="false" /> 35 <element signature="e#336#608#0#PHP" expanded="false" />
36 <element signature="e#614#976#0#PHP" expanded="false" /> 36 <element signature="e#614#976#0#PHP" expanded="false" />
37 <element signature="e#981#2020#0#PHP" expanded="false" /> 37 <element signature="e#981#2020#0#PHP" expanded="false" />
38 <element signature="e#2026#2263#0#PHP" expanded="false" /> 38 <element signature="e#2026#2263#0#PHP" expanded="false" />
  39 + <element signature="e#2268#3059#0#PHP" expanded="false" />
39 <element signature="e#3065#3374#0#PHP" expanded="false" /> 40 <element signature="e#3065#3374#0#PHP" expanded="false" />
40 - <element signature="e#4582#5061#0#PHP" expanded="false" />  
41 - <element signature="e#5066#5633#0#PHP" expanded="false" />  
42 - <element signature="e#5639#5881#0#PHP" expanded="false" /> 41 + <element signature="e#5277#5756#0#PHP" expanded="false" />
  42 + <element signature="e#5761#6328#0#PHP" expanded="false" />
43 </folding> 43 </folding>
44 </state> 44 </state>
45 </provider> 45 </provider>
46 </entry> 46 </entry>
47 </file> 47 </file>
48 - <file leaf-file-name="WeixinPay.php" pinned="false" current-in-tab="false">  
49 - <entry file="file://$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php">  
50 - <provider selected="true" editor-type-id="text-editor">  
51 - <state relative-caret-position="-150">  
52 - <caret line="15" column="13" lean-forward="false" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" />  
53 - <folding>  
54 - <element signature="e#4053#4327#0#PHP" expanded="false" />  
55 - <element signature="e#4346#4809#0#PHP" expanded="false" />  
56 - <element signature="e#4839#5271#0#PHP" expanded="false" />  
57 - </folding>  
58 - </state>  
59 - </provider>  
60 - </entry>  
61 - </file>  
62 - <file leaf-file-name="config.php" pinned="false" current-in-tab="false">  
63 - <entry file="file://$PROJECT_DIR$/api/config.php">  
64 - <provider selected="true" editor-type-id="text-editor">  
65 - <state relative-caret-position="686">  
66 - <caret line="265" column="0" lean-forward="true" selection-start-line="265" selection-start-column="0" selection-end-line="265" selection-end-column="0" />  
67 - <folding />  
68 - </state>  
69 - </provider>  
70 - </entry>  
71 - </file>  
72 - <file leaf-file-name="PayController.php" pinned="false" current-in-tab="true"> 48 + <file leaf-file-name="PayController.php" pinned="false" current-in-tab="false">
73 <entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php"> 49 <entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
74 <provider selected="true" editor-type-id="text-editor"> 50 <provider selected="true" editor-type-id="text-editor">
75 - <state relative-caret-position="636">  
76 - <caret line="171" column="31" lean-forward="false" selection-start-line="171" selection-start-column="31" selection-end-line="171" selection-end-column="31" /> 51 + <state relative-caret-position="336">
  52 + <caret line="159" column="47" lean-forward="true" selection-start-line="159" selection-start-column="47" selection-end-line="159" selection-end-column="47" />
77 <folding> 53 <folding>
78 <element signature="e#40#78#0#PHP" expanded="true" /> 54 <element signature="e#40#78#0#PHP" expanded="true" />
79 - <element signature="e#949#1013#0#PHP" expanded="false" />  
80 - <element signature="e#1018#1851#0#PHP" expanded="false" />  
81 - <element signature="e#1857#1938#0#PHP" expanded="false" />  
82 - <element signature="e#1943#3995#0#PHP" expanded="false" />  
83 - <element signature="e#4002#4025#0#PHP" expanded="false" />  
84 - <element signature="e#4030#4289#0#PHP" expanded="false" />  
85 - <element signature="e#4296#4345#0#PHP" expanded="false" />  
86 - <element signature="e#4350#4778#0#PHP" expanded="false" />  
87 - <element signature="e#4785#4849#0#PHP" expanded="false" /> 55 + <element signature="e#947#1011#0#PHP" expanded="false" />
  56 + <element signature="e#1016#1849#0#PHP" expanded="false" />
  57 + <element signature="e#1855#1936#0#PHP" expanded="false" />
  58 + <element signature="e#1941#3993#0#PHP" expanded="false" />
  59 + <element signature="e#4000#4023#0#PHP" expanded="false" />
  60 + <element signature="e#4028#4287#0#PHP" expanded="false" />
  61 + <element signature="e#4294#4343#0#PHP" expanded="false" />
  62 + <element signature="e#4348#4776#0#PHP" expanded="false" />
  63 + <element signature="e#4783#4847#0#PHP" expanded="false" />
88 </folding> 64 </folding>
89 </state> 65 </state>
90 </provider> 66 </provider>
91 </entry> 67 </entry>
92 </file> 68 </file>
93 - <file leaf-file-name="common.php" pinned="false" current-in-tab="false">  
94 - <entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">  
95 - <provider selected="true" editor-type-id="text-editor">  
96 - <state relative-caret-position="286">  
97 - <caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />  
98 - <folding />  
99 - </state>  
100 - </provider>  
101 - </entry>  
102 - </file>  
103 </leaf> 69 </leaf>
104 </component> 70 </component>
105 <component name="FileTemplateManagerImpl"> 71 <component name="FileTemplateManagerImpl">
@@ -169,8 +135,8 @@ @@ -169,8 +135,8 @@
169 <option value="$PROJECT_DIR$/simplewind/cmf/common.php" /> 135 <option value="$PROJECT_DIR$/simplewind/cmf/common.php" />
170 <option value="$PROJECT_DIR$/api/index/controller/UserController.php" /> 136 <option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
171 <option value="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" /> 137 <option value="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" />
172 - <option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />  
173 <option value="$PROJECT_DIR$/api/index/controller/PayController.php" /> 138 <option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
  139 + <option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
174 </list> 140 </list>
175 </option> 141 </option>
176 </component> 142 </component>
@@ -189,7 +155,7 @@ @@ -189,7 +155,7 @@
189 </component> 155 </component>
190 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 156 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
191 <component name="ProjectFrameBounds" extendedState="1"> 157 <component name="ProjectFrameBounds" extendedState="1">
192 - <option name="x" value="152" /> 158 + <option name="x" value="81" />
193 <option name="y" value="58" /> 159 <option name="y" value="58" />
194 <option name="width" value="1618" /> 160 <option name="width" value="1618" />
195 <option name="height" value="1023" /> 161 <option name="height" value="1023" />
@@ -349,18 +315,18 @@ @@ -349,18 +315,18 @@
349 <workItem from="1575527294268" duration="10705000" /> 315 <workItem from="1575527294268" duration="10705000" />
350 <workItem from="1575543830603" duration="2980000" /> 316 <workItem from="1575543830603" duration="2980000" />
351 <workItem from="1575592067577" duration="15900000" /> 317 <workItem from="1575592067577" duration="15900000" />
352 - <workItem from="1575615529386" duration="4280000" /> 318 + <workItem from="1575615529386" duration="5898000" />
353 </task> 319 </task>
354 <servers /> 320 <servers />
355 </component> 321 </component>
356 <component name="TimeTrackingManager"> 322 <component name="TimeTrackingManager">
357 - <option name="totallyTimeSpent" value="515677000" /> 323 + <option name="totallyTimeSpent" value="517295000" />
358 </component> 324 </component>
359 <component name="ToolWindowManager"> 325 <component name="ToolWindowManager">
360 - <frame x="152" y="58" width="1618" height="1023" extended-state="1" /> 326 + <frame x="81" y="58" width="1618" height="1023" extended-state="1" />
361 <editor active="true" /> 327 <editor active="true" />
362 <layout> 328 <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.22978178" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> 329 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.22978178" sideWeight="0.5" order="0" 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.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> 330 <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" />
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="7" side_tool="true" content_ui="tabs" /> 331 <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" />
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.32982457" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> 332 <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" />
@@ -886,6 +852,22 @@ @@ -886,6 +852,22 @@
886 </state> 852 </state>
887 </provider> 853 </provider>
888 </entry> 854 </entry>
  855 + <entry file="file://$PROJECT_DIR$/simplewind/vendor/overtrue/wechat/src/Foundation/Application.php">
  856 + <provider selected="true" editor-type-id="text-editor">
  857 + <state relative-caret-position="278">
  858 + <caret line="77" column="6" lean-forward="false" selection-start-line="77" selection-start-column="6" selection-end-line="77" selection-end-column="6" />
  859 + <folding />
  860 + </state>
  861 + </provider>
  862 + </entry>
  863 + <entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
  864 + <provider selected="true" editor-type-id="text-editor">
  865 + <state relative-caret-position="-689">
  866 + <caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />
  867 + <folding />
  868 + </state>
  869 + </provider>
  870 + </entry>
889 <entry file="file://$PROJECT_DIR$/api/config.php"> 871 <entry file="file://$PROJECT_DIR$/api/config.php">
890 <provider selected="true" editor-type-id="text-editor"> 872 <provider selected="true" editor-type-id="text-editor">
891 <state relative-caret-position="686"> 873 <state relative-caret-position="686">
@@ -906,55 +888,39 @@ @@ -906,55 +888,39 @@
906 </state> 888 </state>
907 </provider> 889 </provider>
908 </entry> 890 </entry>
909 - <entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php"> 891 + <entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
910 <provider selected="true" editor-type-id="text-editor"> 892 <provider selected="true" editor-type-id="text-editor">
911 - <state relative-caret-position="166">  
912 - <caret line="109" column="24" lean-forward="false" selection-start-line="109" selection-start-column="24" selection-end-line="109" selection-end-column="24" /> 893 + <state relative-caret-position="336">
  894 + <caret line="159" column="47" lean-forward="true" selection-start-line="159" selection-start-column="47" selection-end-line="159" selection-end-column="47" />
913 <folding> 895 <folding>
914 - <element signature="e#131#162#0#PHP" expanded="true" />  
915 - <element signature="e#336#608#0#PHP" expanded="false" />  
916 - <element signature="e#614#976#0#PHP" expanded="false" />  
917 - <element signature="e#981#2020#0#PHP" expanded="false" />  
918 - <element signature="e#2026#2263#0#PHP" expanded="false" />  
919 - <element signature="e#3065#3374#0#PHP" expanded="false" />  
920 - <element signature="e#4582#5061#0#PHP" expanded="false" />  
921 - <element signature="e#5066#5633#0#PHP" expanded="false" />  
922 - <element signature="e#5639#5881#0#PHP" expanded="false" /> 896 + <element signature="e#40#78#0#PHP" expanded="true" />
  897 + <element signature="e#947#1011#0#PHP" expanded="false" />
  898 + <element signature="e#1016#1849#0#PHP" expanded="false" />
  899 + <element signature="e#1855#1936#0#PHP" expanded="false" />
  900 + <element signature="e#1941#3993#0#PHP" expanded="false" />
  901 + <element signature="e#4000#4023#0#PHP" expanded="false" />
  902 + <element signature="e#4028#4287#0#PHP" expanded="false" />
  903 + <element signature="e#4294#4343#0#PHP" expanded="false" />
  904 + <element signature="e#4348#4776#0#PHP" expanded="false" />
  905 + <element signature="e#4783#4847#0#PHP" expanded="false" />
923 </folding> 906 </folding>
924 </state> 907 </state>
925 </provider> 908 </provider>
926 </entry> 909 </entry>
927 - <entry file="file://$PROJECT_DIR$/simplewind/vendor/overtrue/wechat/src/Foundation/Application.php">  
928 - <provider selected="true" editor-type-id="text-editor">  
929 - <state relative-caret-position="278">  
930 - <caret line="77" column="6" lean-forward="false" selection-start-line="77" selection-start-column="6" selection-end-line="77" selection-end-column="6" />  
931 - <folding />  
932 - </state>  
933 - </provider>  
934 - </entry>  
935 - <entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php"> 910 + <entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
936 <provider selected="true" editor-type-id="text-editor"> 911 <provider selected="true" editor-type-id="text-editor">
937 <state relative-caret-position="286"> 912 <state relative-caret-position="286">
938 - <caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />  
939 - <folding />  
940 - </state>  
941 - </provider>  
942 - </entry>  
943 - <entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">  
944 - <provider selected="true" editor-type-id="text-editor">  
945 - <state relative-caret-position="636">  
946 - <caret line="171" column="31" lean-forward="false" selection-start-line="171" selection-start-column="31" selection-end-line="171" selection-end-column="31" /> 913 + <caret line="157" column="41" lean-forward="true" selection-start-line="157" selection-start-column="41" selection-end-line="157" selection-end-column="41" />
947 <folding> 914 <folding>
948 - <element signature="e#40#78#0#PHP" expanded="true" />  
949 - <element signature="e#949#1013#0#PHP" expanded="false" />  
950 - <element signature="e#1018#1851#0#PHP" expanded="false" />  
951 - <element signature="e#1857#1938#0#PHP" expanded="false" />  
952 - <element signature="e#1943#3995#0#PHP" expanded="false" />  
953 - <element signature="e#4002#4025#0#PHP" expanded="false" />  
954 - <element signature="e#4030#4289#0#PHP" expanded="false" />  
955 - <element signature="e#4296#4345#0#PHP" expanded="false" />  
956 - <element signature="e#4350#4778#0#PHP" expanded="false" />  
957 - <element signature="e#4785#4849#0#PHP" expanded="false" /> 915 + <element signature="e#131#162#0#PHP" expanded="true" />
  916 + <element signature="e#336#608#0#PHP" expanded="false" />
  917 + <element signature="e#614#976#0#PHP" expanded="false" />
  918 + <element signature="e#981#2020#0#PHP" expanded="false" />
  919 + <element signature="e#2026#2263#0#PHP" expanded="false" />
  920 + <element signature="e#2268#3059#0#PHP" expanded="false" />
  921 + <element signature="e#3065#3374#0#PHP" expanded="false" />
  922 + <element signature="e#5277#5756#0#PHP" expanded="false" />
  923 + <element signature="e#5761#6328#0#PHP" expanded="false" />
958 </folding> 924 </folding>
959 </state> 925 </state>
960 </provider> 926 </provider>
@@ -153,9 +153,20 @@ class OrderController extends RestBaseController @@ -153,9 +153,20 @@ class OrderController extends RestBaseController
153 if($withdraw['return_code'] == 'SUCCESS') { 153 if($withdraw['return_code'] == 'SUCCESS') {
154 if ($withdraw['result_code'] == 'SUCCESS') { 154 if ($withdraw['result_code'] == 'SUCCESS') {
155 // 提现成功 155 // 提现成功
156 -  
157 -  
158 - 156 + $order['user_id'] = $user_id;
  157 + $order['money_id'] = $money_id;
  158 + $order['total'] = $total;
  159 + $order['create_time'] = time();
  160 + Db::name('tixian')->insertGetId($order);
  161 + //修改现在的积分
  162 + $ji = $list['now_integral'] - $info['integral'];
  163 + Db::name('integral')->where('user_id',$user_id)->update(['now_integral'=>$ji]);
  164 + //增加积分明细
  165 + $detail['user_id'] = $user_id;
  166 + $detail['total'] = $info['integral'];
  167 + $detail['type'] = 4;
  168 + $detail['create_time'] = time();
  169 + Db::name('detail')->insertGetId($detail);
159 $this->success('success123'); 170 $this->success('success123');
160 }else{ 171 }else{
161 $this->error($withdraw['err_code_des']); 172 $this->error($withdraw['err_code_des']);
@@ -208,6 +219,7 @@ class OrderController extends RestBaseController @@ -208,6 +219,7 @@ class OrderController extends RestBaseController
208 ->where('user_id',$user_id) 219 ->where('user_id',$user_id)
209 ->field('openid') 220 ->field('openid')
210 ->find(); 221 ->find();
211 - return $openid; 222 +
  223 + return $openid['openid'];
212 } 224 }
213 } 225 }
@@ -21,7 +21,7 @@ class PayController extends HomeBaseController @@ -21,7 +21,7 @@ class PayController extends HomeBaseController
21 parent::_initialize(); 21 parent::_initialize();
22 $this->options = [ 22 $this->options = [
23 'app_id' => 'wxd7010deb3b696146', 23 'app_id' => 'wxd7010deb3b696146',
24 - //'secret' => '282f4cc8536523076c9d16af6331ffb6', 24 + 'secret' => '282f4cc8536523076c9d16af6331ffb6',
25 'payment' => [ 25 'payment' => [
26 'merchant_id' => '1563087351', 26 'merchant_id' => '1563087351',
27 'key' => 'P1GSxsjA4Ts3g6V95FVE49bNQLClGckS', 27 'key' => 'P1GSxsjA4Ts3g6V95FVE49bNQLClGckS',
@@ -161,15 +161,14 @@ class PayController extends HomeBaseController @@ -161,15 +161,14 @@ class PayController extends HomeBaseController
161 $merchantPay = $app->merchant_pay; 161 $merchantPay = $app->merchant_pay;
162 $merchantPayData = [ 162 $merchantPayData = [
163 'partner_trade_no' => cmf_get_order_sn(), //随机字符串作为订单号,跟红包和支付一个概念。 163 'partner_trade_no' => cmf_get_order_sn(), //随机字符串作为订单号,跟红包和支付一个概念。
164 - 'openid' => 'oiDoO5GTLk4fYJG6rwiReK-5PDME', //收款人的openid 164 + 'openid' => $data['openid'], //收款人的openid
165 'check_name' => 'NO_CHECK', //文档中有三种校验实名的方法 NO_CHECK OPTION_CHECK FORCE_CHECK 165 'check_name' => 'NO_CHECK', //文档中有三种校验实名的方法 NO_CHECK OPTION_CHECK FORCE_CHECK
166 're_user_name'=>'', //OPTION_CHECK FORCE_CHECK 校验实名的时候必须提交 166 're_user_name'=>'', //OPTION_CHECK FORCE_CHECK 校验实名的时候必须提交
167 - 'amount' => 0.5*100, //单位为分 167 + 'amount' => (1-0.006)*$data['total']*100, //单位为分
168 'desc' => '提现到零钱', 168 'desc' => '提现到零钱',
169 'spbill_create_ip' => '192.168.0.1', //发起交易的IP地址 169 'spbill_create_ip' => '192.168.0.1', //发起交易的IP地址
170 ]; 170 ];
171 $result = $merchantPay->send($merchantPayData); 171 $result = $merchantPay->send($merchantPayData);
172 - var_dump($result);exit;  
173 return $result; 172 return $result;
174 } 173 }
175 } 174 }