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

修改支付

... ... @@ -25,81 +25,47 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="false">
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="166">
<caret line="109" column="24" lean-forward="false" selection-start-line="109" selection-start-column="24" selection-end-line="109" selection-end-column="24" />
<state relative-caret-position="286">
<caret line="157" column="41" lean-forward="true" selection-start-line="157" selection-start-column="41" selection-end-line="157" selection-end-column="41" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#336#608#0#PHP" expanded="false" />
<element signature="e#614#976#0#PHP" expanded="false" />
<element signature="e#981#2020#0#PHP" expanded="false" />
<element signature="e#2026#2263#0#PHP" expanded="false" />
<element signature="e#2268#3059#0#PHP" expanded="false" />
<element signature="e#3065#3374#0#PHP" expanded="false" />
<element signature="e#4582#5061#0#PHP" expanded="false" />
<element signature="e#5066#5633#0#PHP" expanded="false" />
<element signature="e#5639#5881#0#PHP" expanded="false" />
<element signature="e#5277#5756#0#PHP" expanded="false" />
<element signature="e#5761#6328#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WeixinPay.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-150">
<caret line="15" column="13" lean-forward="false" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" />
<folding>
<element signature="e#4053#4327#0#PHP" expanded="false" />
<element signature="e#4346#4809#0#PHP" expanded="false" />
<element signature="e#4839#5271#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="config.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="686">
<caret line="265" column="0" lean-forward="true" selection-start-line="265" selection-start-column="0" selection-end-line="265" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PayController.php" pinned="false" current-in-tab="true">
<file leaf-file-name="PayController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="636">
<caret line="171" column="31" lean-forward="false" selection-start-line="171" selection-start-column="31" selection-end-line="171" selection-end-column="31" />
<state relative-caret-position="336">
<caret line="159" column="47" lean-forward="true" selection-start-line="159" selection-start-column="47" selection-end-line="159" selection-end-column="47" />
<folding>
<element signature="e#40#78#0#PHP" expanded="true" />
<element signature="e#949#1013#0#PHP" expanded="false" />
<element signature="e#1018#1851#0#PHP" expanded="false" />
<element signature="e#1857#1938#0#PHP" expanded="false" />
<element signature="e#1943#3995#0#PHP" expanded="false" />
<element signature="e#4002#4025#0#PHP" expanded="false" />
<element signature="e#4030#4289#0#PHP" expanded="false" />
<element signature="e#4296#4345#0#PHP" expanded="false" />
<element signature="e#4350#4778#0#PHP" expanded="false" />
<element signature="e#4785#4849#0#PHP" expanded="false" />
<element signature="e#947#1011#0#PHP" expanded="false" />
<element signature="e#1016#1849#0#PHP" expanded="false" />
<element signature="e#1855#1936#0#PHP" expanded="false" />
<element signature="e#1941#3993#0#PHP" expanded="false" />
<element signature="e#4000#4023#0#PHP" expanded="false" />
<element signature="e#4028#4287#0#PHP" expanded="false" />
<element signature="e#4294#4343#0#PHP" expanded="false" />
<element signature="e#4348#4776#0#PHP" expanded="false" />
<element signature="e#4783#4847#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="common.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
... ... @@ -169,8 +135,8 @@
<option value="$PROJECT_DIR$/simplewind/cmf/common.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
<option value="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
</list>
</option>
</component>
... ... @@ -189,7 +155,7 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="152" />
<option name="x" value="81" />
<option name="y" value="58" />
<option name="width" value="1618" />
<option name="height" value="1023" />
... ... @@ -349,18 +315,18 @@
<workItem from="1575527294268" duration="10705000" />
<workItem from="1575543830603" duration="2980000" />
<workItem from="1575592067577" duration="15900000" />
<workItem from="1575615529386" duration="4280000" />
<workItem from="1575615529386" duration="5898000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="515677000" />
<option name="totallyTimeSpent" value="517295000" />
</component>
<component name="ToolWindowManager">
<frame x="152" y="58" width="1618" height="1023" extended-state="1" />
<frame x="81" y="58" width="1618" height="1023" extended-state="1" />
<editor active="true" />
<layout>
<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" />
<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" />
<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" />
<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" />
<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 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/vendor/overtrue/wechat/src/Foundation/Application.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="278">
<caret line="77" column="6" lean-forward="false" selection-start-line="77" selection-start-column="6" selection-end-line="77" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-689">
<caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="686">
... ... @@ -906,55 +888,39 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="166">
<caret line="109" column="24" lean-forward="false" selection-start-line="109" selection-start-column="24" selection-end-line="109" selection-end-column="24" />
<state relative-caret-position="336">
<caret line="159" column="47" lean-forward="true" selection-start-line="159" selection-start-column="47" selection-end-line="159" selection-end-column="47" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#336#608#0#PHP" expanded="false" />
<element signature="e#614#976#0#PHP" expanded="false" />
<element signature="e#981#2020#0#PHP" expanded="false" />
<element signature="e#2026#2263#0#PHP" expanded="false" />
<element signature="e#3065#3374#0#PHP" expanded="false" />
<element signature="e#4582#5061#0#PHP" expanded="false" />
<element signature="e#5066#5633#0#PHP" expanded="false" />
<element signature="e#5639#5881#0#PHP" expanded="false" />
<element signature="e#40#78#0#PHP" expanded="true" />
<element signature="e#947#1011#0#PHP" expanded="false" />
<element signature="e#1016#1849#0#PHP" expanded="false" />
<element signature="e#1855#1936#0#PHP" expanded="false" />
<element signature="e#1941#3993#0#PHP" expanded="false" />
<element signature="e#4000#4023#0#PHP" expanded="false" />
<element signature="e#4028#4287#0#PHP" expanded="false" />
<element signature="e#4294#4343#0#PHP" expanded="false" />
<element signature="e#4348#4776#0#PHP" expanded="false" />
<element signature="e#4783#4847#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/vendor/overtrue/wechat/src/Foundation/Application.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="278">
<caret line="77" column="6" lean-forward="false" selection-start-line="77" selection-start-column="6" selection-end-line="77" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="1144" column="9" lean-forward="false" selection-start-line="1144" selection-start-column="9" selection-end-line="1144" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="636">
<caret line="171" column="31" lean-forward="false" selection-start-line="171" selection-start-column="31" selection-end-line="171" selection-end-column="31" />
<caret line="157" column="41" lean-forward="true" selection-start-line="157" selection-start-column="41" selection-end-line="157" selection-end-column="41" />
<folding>
<element signature="e#40#78#0#PHP" expanded="true" />
<element signature="e#949#1013#0#PHP" expanded="false" />
<element signature="e#1018#1851#0#PHP" expanded="false" />
<element signature="e#1857#1938#0#PHP" expanded="false" />
<element signature="e#1943#3995#0#PHP" expanded="false" />
<element signature="e#4002#4025#0#PHP" expanded="false" />
<element signature="e#4030#4289#0#PHP" expanded="false" />
<element signature="e#4296#4345#0#PHP" expanded="false" />
<element signature="e#4350#4778#0#PHP" expanded="false" />
<element signature="e#4785#4849#0#PHP" expanded="false" />
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#336#608#0#PHP" expanded="false" />
<element signature="e#614#976#0#PHP" expanded="false" />
<element signature="e#981#2020#0#PHP" expanded="false" />
<element signature="e#2026#2263#0#PHP" expanded="false" />
<element signature="e#2268#3059#0#PHP" expanded="false" />
<element signature="e#3065#3374#0#PHP" expanded="false" />
<element signature="e#5277#5756#0#PHP" expanded="false" />
<element signature="e#5761#6328#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -153,9 +153,20 @@ class OrderController extends RestBaseController
if($withdraw['return_code'] == 'SUCCESS') {
if ($withdraw['result_code'] == 'SUCCESS') {
// 提现成功
$order['user_id'] = $user_id;
$order['money_id'] = $money_id;
$order['total'] = $total;
$order['create_time'] = time();
Db::name('tixian')->insertGetId($order);
//修改现在的积分
$ji = $list['now_integral'] - $info['integral'];
Db::name('integral')->where('user_id',$user_id)->update(['now_integral'=>$ji]);
//增加积分明细
$detail['user_id'] = $user_id;
$detail['total'] = $info['integral'];
$detail['type'] = 4;
$detail['create_time'] = time();
Db::name('detail')->insertGetId($detail);
$this->success('success123');
}else{
$this->error($withdraw['err_code_des']);
... ... @@ -208,6 +219,7 @@ class OrderController extends RestBaseController
->where('user_id',$user_id)
->field('openid')
->find();
return $openid;
return $openid['openid'];
}
}
\ No newline at end of file
... ...
... ... @@ -21,7 +21,7 @@ class PayController extends HomeBaseController
parent::_initialize();
$this->options = [
'app_id' => 'wxd7010deb3b696146',
//'secret' => '282f4cc8536523076c9d16af6331ffb6',
'secret' => '282f4cc8536523076c9d16af6331ffb6',
'payment' => [
'merchant_id' => '1563087351',
'key' => 'P1GSxsjA4Ts3g6V95FVE49bNQLClGckS',
... ... @@ -161,15 +161,14 @@ class PayController extends HomeBaseController
$merchantPay = $app->merchant_pay;
$merchantPayData = [
'partner_trade_no' => cmf_get_order_sn(), //随机字符串作为订单号,跟红包和支付一个概念。
'openid' => 'oiDoO5GTLk4fYJG6rwiReK-5PDME', //收款人的openid
'openid' => $data['openid'], //收款人的openid
'check_name' => 'NO_CHECK', //文档中有三种校验实名的方法 NO_CHECK OPTION_CHECK FORCE_CHECK
're_user_name'=>'', //OPTION_CHECK FORCE_CHECK 校验实名的时候必须提交
'amount' => 0.5*100, //单位为分
'amount' => (1-0.006)*$data['total']*100, //单位为分
'desc' => '提现到零钱',
'spbill_create_ip' => '192.168.0.1', //发起交易的IP地址
];
$result = $merchantPay->send($merchantPayData);
var_dump($result);exit;
return $result;
}
}
\ No newline at end of file
... ...