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

修改支付

... ... @@ -88,8 +88,8 @@
<file leaf-file-name="Pay.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="344" column="64" lean-forward="false" selection-start-line="344" selection-start-column="64" selection-end-line="344" selection-end-column="64" />
<state relative-caret-position="129">
<caret line="195" column="41" lean-forward="true" selection-start-line="195" selection-start-column="41" selection-end-line="195" selection-end-column="41" />
<folding>
<element signature="e#574#693#0#PHP" expanded="false" />
<element signature="e#699#1012#0#PHP" expanded="false" />
... ... @@ -99,18 +99,19 @@
<element signature="e#5512#5930#0#PHP" expanded="false" />
<element signature="e#6179#6269#0#PHP" expanded="false" />
<element signature="e#6347#6443#0#PHP" expanded="false" />
<element signature="e#11858#13633#0#PHP" expanded="false" />
<element signature="e#13706#14126#0#PHP" expanded="false" />
<element signature="e#21801#22098#0#PHP" expanded="false" />
<element signature="e#22103#22496#0#PHP" expanded="false" />
<element signature="e#22523#26001#0#PHP" expanded="false" />
<element signature="e#26030#28935#0#PHP" expanded="false" />
<element signature="e#28964#32883#0#PHP" expanded="false" />
<element signature="e#30935#32372#0#PHP" expanded="false" />
<element signature="e#31394#32350#0#PHP" expanded="false" />
<element signature="e#32912#36995#0#PHP" expanded="false" />
<element signature="e#34762#36510#0#PHP" expanded="false" />
<element signature="e#37018#37235#0#PHP" expanded="false" />
<element signature="e#11994#13769#0#PHP" expanded="false" />
<element signature="e#13842#14262#0#PHP" expanded="false" />
<element signature="e#14267#21920#0#PHP" expanded="false" />
<element signature="e#21937#22234#0#PHP" expanded="false" />
<element signature="e#22239#22632#0#PHP" expanded="false" />
<element signature="e#22659#26137#0#PHP" expanded="false" />
<element signature="e#26166#29071#0#PHP" expanded="false" />
<element signature="e#29100#33019#0#PHP" expanded="false" />
<element signature="e#31071#32508#0#PHP" expanded="false" />
<element signature="e#31530#32486#0#PHP" expanded="false" />
<element signature="e#33048#37131#0#PHP" expanded="false" />
<element signature="e#34898#36646#0#PHP" expanded="false" />
<element signature="e#37154#37371#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -203,8 +204,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="124" />
<option name="y" value="48" />
<option name="x" value="307" />
<option name="y" value="132" />
<option name="width" value="1700" />
<option name="height" value="1000" />
</component>
... ... @@ -334,7 +335,7 @@
<workItem from="1575541798312" duration="2359000" />
<workItem from="1575592025964" duration="640000" />
<workItem from="1575599624364" duration="95000" />
<workItem from="1575680867057" duration="12355000" />
<workItem from="1575680867057" duration="12522000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -347,7 +348,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="322254000" />
<option name="totallyTimeSpent" value="322421000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -360,6 +361,7 @@
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
<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.1705757" sideWeight="0.5" order="1" 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.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
... ... @@ -368,7 +370,7 @@
<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" />
<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" />
<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" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15669206" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16685979" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<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" />
<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" />
<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" />
... ... @@ -855,8 +857,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="344" column="64" lean-forward="false" selection-start-line="344" selection-start-column="64" selection-end-line="344" selection-end-column="64" />
<state relative-caret-position="129">
<caret line="195" column="41" lean-forward="true" selection-start-line="195" selection-start-column="41" selection-end-line="195" selection-end-column="41" />
<folding>
<element signature="e#574#693#0#PHP" expanded="false" />
<element signature="e#699#1012#0#PHP" expanded="false" />
... ... @@ -866,18 +868,19 @@
<element signature="e#5512#5930#0#PHP" expanded="false" />
<element signature="e#6179#6269#0#PHP" expanded="false" />
<element signature="e#6347#6443#0#PHP" expanded="false" />
<element signature="e#11858#13633#0#PHP" expanded="false" />
<element signature="e#13706#14126#0#PHP" expanded="false" />
<element signature="e#21801#22098#0#PHP" expanded="false" />
<element signature="e#22103#22496#0#PHP" expanded="false" />
<element signature="e#22523#26001#0#PHP" expanded="false" />
<element signature="e#26030#28935#0#PHP" expanded="false" />
<element signature="e#28964#32883#0#PHP" expanded="false" />
<element signature="e#30935#32372#0#PHP" expanded="false" />
<element signature="e#31394#32350#0#PHP" expanded="false" />
<element signature="e#32912#36995#0#PHP" expanded="false" />
<element signature="e#34762#36510#0#PHP" expanded="false" />
<element signature="e#37018#37235#0#PHP" expanded="false" />
<element signature="e#11994#13769#0#PHP" expanded="false" />
<element signature="e#13842#14262#0#PHP" expanded="false" />
<element signature="e#14267#21920#0#PHP" expanded="false" />
<element signature="e#21937#22234#0#PHP" expanded="false" />
<element signature="e#22239#22632#0#PHP" expanded="false" />
<element signature="e#22659#26137#0#PHP" expanded="false" />
<element signature="e#26166#29071#0#PHP" expanded="false" />
<element signature="e#29100#33019#0#PHP" expanded="false" />
<element signature="e#31071#32508#0#PHP" expanded="false" />
<element signature="e#31530#32486#0#PHP" expanded="false" />
<element signature="e#33048#37131#0#PHP" expanded="false" />
<element signature="e#34898#36646#0#PHP" expanded="false" />
<element signature="e#37154#37371#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -189,6 +189,9 @@ class Pay extends Api
}
$money = $res['money'] - $data['total'];
$uid = $this->uid;
$login = Db::name('user')
->where('id',$uid)
->find();
// 启动事务
Db::startTrans();
try{
... ... @@ -199,7 +202,7 @@ class Pay extends Api
$pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();
$str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],";
//非会员
if($user['is_vip'] == 0){
if($login['is_vip'] == 0){
$money = $pic['money'] + $pic['price'];
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$money]);
}else{
... ...