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

修改充值

... ... @@ -3,6 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="0011664b-87e9-41bd-9f37-18792fb15777" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/OrderController.php" afterPath="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/PayController.php" afterPath="$PROJECT_DIR$/api/index/controller/PayController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -98,22 +99,39 @@
</provider>
</entry>
</file>
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="true">
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="369">
<caret line="48" column="34" lean-forward="false" selection-start-line="48" selection-start-column="34" selection-end-line="48" selection-end-column="34" />
<state relative-caret-position="486">
<caret line="100" column="42" lean-forward="false" selection-start-line="100" selection-start-column="42" selection-end-line="100" selection-end-column="42" />
<folding>
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#970#0#PHP" expanded="false" />
<element signature="e#975#1863#0#PHP" expanded="false" />
<element signature="e#1869#2106#0#PHP" expanded="false" />
<element signature="e#2111#2809#0#PHP" expanded="false" />
<element signature="e#2815#3057#0#PHP" expanded="false" />
<element signature="e#3063#3300#0#PHP" expanded="false" />
<element signature="e#3305#3377#0#PHP" expanded="false" />
<element signature="e#3383#3862#0#PHP" expanded="false" />
<element signature="e#3867#4410#0#PHP" expanded="false" />
<element signature="e#975#1835#0#PHP" expanded="false" />
<element signature="e#2787#3029#0#PHP" expanded="false" />
<element signature="e#3035#3272#0#PHP" expanded="false" />
<element signature="e#3277#3349#0#PHP" expanded="false" />
<element signature="e#3355#3834#0#PHP" expanded="false" />
<element signature="e#3839#4382#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PayController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214">
<caret line="111" column="13" lean-forward="true" selection-start-line="111" selection-start-column="13" selection-end-line="111" selection-end-column="13" />
<folding>
<element signature="e#324#855#0#PHP" expanded="false" />
<element signature="e#930#1766#0#PHP" expanded="false" />
<element signature="e#1772#1853#0#PHP" expanded="false" />
<element signature="e#3883#4142#0#PHP" expanded="false" />
<element signature="e#4149#4198#0#PHP" expanded="false" />
<element signature="e#4203#4631#0#PHP" expanded="false" />
<element signature="e#4637#4701#0#PHP" expanded="false" />
<element signature="e#4706#5580#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -190,7 +208,6 @@
<option value="$PROJECT_DIR$/app/admin/controller/MoneyController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/money/payedit.html" />
<option value="$PROJECT_DIR$/app/config.php" />
<option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
<option value="$PROJECT_DIR$/app/admin/controller/KnowController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/know/index.html" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html" />
... ... @@ -227,6 +244,7 @@
<option value="$PROJECT_DIR$/api/index/controller/HomeController.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
</list>
</option>
</component>
... ... @@ -244,11 +262,11 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="773" />
<option name="y" value="54" />
<option name="width" value="1582" />
<option name="height" value="1056" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="218" />
<option name="y" value="394" />
<option name="width" value="1700" />
<option name="height" value="1051" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -395,18 +413,18 @@
<workItem from="1575431441427" duration="8414000" />
<workItem from="1575444399653" duration="12810000" />
<workItem from="1575462840839" duration="250000" />
<workItem from="1575506248144" duration="8181000" />
<workItem from="1575506248144" duration="10390000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="474890000" />
<option name="totallyTimeSpent" value="477099000" />
</component>
<component name="ToolWindowManager">
<frame x="773" y="54" width="1582" height="1056" extended-state="0" />
<frame x="218" y="394" width="1700" height="1051" 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.174113" 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="true" show_stripe_button="true" weight="0.16158536" 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" />
... ... @@ -457,20 +475,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/api/config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="418">
<caret line="258" column="11" lean-forward="true" selection-start-line="258" selection-start-column="11" selection-end-line="258" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/thinkphp/library/think/Config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2200">
<caret line="13" column="6" lean-forward="false" selection-start-line="13" selection-start-column="6" selection-end-line="13" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/thinkphp/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="280">
... ... @@ -694,13 +698,6 @@
</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="-783">
<caret line="18" column="26" lean-forward="false" selection-start-line="18" selection-start-column="26" selection-end-line="18" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ProjectController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="575">
... ... @@ -966,21 +963,52 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/model/OrderModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="325">
<caret line="18" column="20" lean-forward="false" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-529">
<caret line="19" column="20" lean-forward="false" selection-start-line="19" selection-start-column="20" selection-end-line="19" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="369">
<caret line="48" column="34" lean-forward="false" selection-start-line="48" selection-start-column="34" selection-end-line="48" selection-end-column="34" />
<state relative-caret-position="486">
<caret line="100" column="42" lean-forward="false" selection-start-line="100" selection-start-column="42" selection-end-line="100" selection-end-column="42" />
<folding>
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#970#0#PHP" expanded="false" />
<element signature="e#975#1863#0#PHP" expanded="false" />
<element signature="e#1869#2106#0#PHP" expanded="false" />
<element signature="e#2111#2809#0#PHP" expanded="false" />
<element signature="e#2815#3057#0#PHP" expanded="false" />
<element signature="e#3063#3300#0#PHP" expanded="false" />
<element signature="e#3305#3377#0#PHP" expanded="false" />
<element signature="e#3383#3862#0#PHP" expanded="false" />
<element signature="e#3867#4410#0#PHP" expanded="false" />
<element signature="e#975#1835#0#PHP" expanded="false" />
<element signature="e#2787#3029#0#PHP" expanded="false" />
<element signature="e#3035#3272#0#PHP" expanded="false" />
<element signature="e#3277#3349#0#PHP" expanded="false" />
<element signature="e#3355#3834#0#PHP" expanded="false" />
<element signature="e#3839#4382#0#PHP" expanded="false" />
</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="214">
<caret line="111" column="13" lean-forward="true" selection-start-line="111" selection-start-column="13" selection-end-line="111" selection-end-column="13" />
<folding>
<element signature="e#324#855#0#PHP" expanded="false" />
<element signature="e#930#1766#0#PHP" expanded="false" />
<element signature="e#1772#1853#0#PHP" expanded="false" />
<element signature="e#3883#4142#0#PHP" expanded="false" />
<element signature="e#4149#4198#0#PHP" expanded="false" />
<element signature="e#4203#4631#0#PHP" expanded="false" />
<element signature="e#4637#4701#0#PHP" expanded="false" />
<element signature="e#4706#5580#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -64,7 +64,6 @@ class OrderController extends RestBaseController
$arr['pay_id'] = $pay_id;
$arr['total'] = $total;
$arr['create_time'] = time();
$arr['status'] = 1;
$orderModel = new OrderModel();
$result = $orderModel->order_add($arr);
if(empty($result)){
... ...
... ... @@ -86,27 +86,27 @@ class PayController extends HomeBaseController
}
// 用户是否支付成功
if ($successful) {
//添加我的积分记录
$update['pay_time']=time();
$update['status'] = 2;
$arr = Db::name('pay')
->where('id',$order['pay_id'])
->field('integral')
->find();
$list = Db::name('integral')
->where('user_id',$order['user_id'])
->find();
$res['before_wallet'] = $list['now_integral'];
$res['user_id'] = $order['user_id'];
$res['total'] = $arr['integral'];
$res['after_wallet'] = $arr['before_wallet'] + $arr['integral'];
$res['type'] = 1;
Db::name('detail')
->insertGetId($res);
//修改我的信息中的当前积分
$list = Db::name('integral')
->where('user_id',$order['user_id'])
->update($res);
$after_wallet = $res['after_wallet'];
->find();
$now_integral = $list['now_integral'];
$add_total = $list['add_total'] + $res['total'];
Db::name('integral')
->where('user_id',$order['user_id'])
->update(['now_integral'=>$after_wallet,'add_total'=>$add_total]);
->update(['now_integral'=>$now_integral,'add_total'=>$add_total]);
} else { // 用户支付失败
$update['status']=1;
}
... ...