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

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

... ... @@ -2,9 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/lang/zh-cn/pic.php" afterPath="$PROJECT_DIR$/application/admin/lang/zh-cn/pic.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/assets/js/backend/pic.js" afterPath="$PROJECT_DIR$/public/assets/js/backend/pic.js" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -90,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="96">
<caret line="370" column="37" lean-forward="false" selection-start-line="370" selection-start-column="37" selection-end-line="370" selection-end-column="37" />
<state relative-caret-position="159">
<caret line="742" column="40" lean-forward="true" selection-start-line="742" selection-start-column="40" selection-end-line="742" selection-end-column="40" />
<folding>
<element signature="e#574#693#0#PHP" expanded="false" />
<element signature="e#699#1012#0#PHP" expanded="false" />
... ... @@ -99,17 +97,18 @@
<element signature="e#3099#3419#0#PHP" expanded="false" />
<element signature="e#3424#5506#0#PHP" expanded="false" />
<element signature="e#5512#5930#0#PHP" expanded="false" />
<element signature="e#5935#14097#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#12255#14030#0#PHP" expanded="false" />
<element signature="e#14103#14523#0#PHP" expanded="false" />
<element signature="e#14528#22620#0#PHP" expanded="false" />
<element signature="e#22637#22934#0#PHP" expanded="false" />
<element signature="e#22939#23332#0#PHP" expanded="false" />
<element signature="e#23359#26837#0#PHP" expanded="false" />
<element signature="e#26866#29771#0#PHP" expanded="false" />
<element signature="e#29800#33250#0#PHP" expanded="false" />
<element signature="e#33279#37016#0#PHP" expanded="false" />
<element signature="e#37039#37256#0#PHP" expanded="false" />
<element signature="e#29800#33976#0#PHP" expanded="false" />
<element signature="e#38491#38708#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -201,9 +200,9 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="204" />
<option name="y" value="166" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="11" />
<option name="y" value="22" />
<option name="width" value="1700" />
<option name="height" value="1000" />
</component>
... ... @@ -333,7 +332,7 @@
<workItem from="1575541798312" duration="2359000" />
<workItem from="1575592025964" duration="640000" />
<workItem from="1575599624364" duration="95000" />
<workItem from="1575680867057" duration="8140000" />
<workItem from="1575680867057" duration="8789000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -346,7 +345,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="318039000" />
<option name="totallyTimeSpent" value="318688000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -358,16 +357,16 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
<frame x="11" y="22" width="1700" height="1000" extended-state="1" />
<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="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" />
<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" />
<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" />
<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" />
<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.09793253" 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.09733488" 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" />
... ... @@ -854,8 +853,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96">
<caret line="370" column="37" lean-forward="false" selection-start-line="370" selection-start-column="37" selection-end-line="370" selection-end-column="37" />
<state relative-caret-position="159">
<caret line="742" column="40" lean-forward="true" selection-start-line="742" selection-start-column="40" selection-end-line="742" selection-end-column="40" />
<folding>
<element signature="e#574#693#0#PHP" expanded="false" />
<element signature="e#699#1012#0#PHP" expanded="false" />
... ... @@ -863,17 +862,18 @@
<element signature="e#3099#3419#0#PHP" expanded="false" />
<element signature="e#3424#5506#0#PHP" expanded="false" />
<element signature="e#5512#5930#0#PHP" expanded="false" />
<element signature="e#5935#14097#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#12255#14030#0#PHP" expanded="false" />
<element signature="e#14103#14523#0#PHP" expanded="false" />
<element signature="e#14528#22620#0#PHP" expanded="false" />
<element signature="e#22637#22934#0#PHP" expanded="false" />
<element signature="e#22939#23332#0#PHP" expanded="false" />
<element signature="e#23359#26837#0#PHP" expanded="false" />
<element signature="e#26866#29771#0#PHP" expanded="false" />
<element signature="e#29800#33250#0#PHP" expanded="false" />
<element signature="e#33279#37016#0#PHP" expanded="false" />
<element signature="e#37039#37256#0#PHP" expanded="false" />
<element signature="e#29800#33976#0#PHP" expanded="false" />
<element signature="e#38491#38708#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -651,10 +651,24 @@ class Pay extends Api
$user = Db::name('user')->where('id',$data['user_id'])->find();
$mobile = $user['mobile'];
$str = "【仁甲看见】";
//判断用户是否为会员
$login = Db::name('user')
->where('id',$data['user_id'])
->field('id,is_vip')
->find();
if(!empty($pic_id)){
foreach ($pic_id as $key => $v){
$pic = Db::name('pic')->field('id,buy_num')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1]);
//非会员
if($login['is_vip'] == 0){
$pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
}else{
//是会员
$pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
}
}
foreach ($pic_id as $key => $v){
$pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();
... ... @@ -719,10 +733,24 @@ class Pay extends Api
$user = Db::name('user')->where('id',$data['user_id'])->find();
$mobile = $user['mobile'];
$str = "【仁甲看见】";
//判断用户是否为会员
$login = Db::name('user')
->where('id',$data['user_id'])
->field('id,is_vip')
->find();
if(!empty($pic_id)){
foreach ($pic_id as $key => $v){
$pic = Db::name('pic')->field('id,buy_num')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1]);
//非会员
if($login['is_vip'] == 0){
$pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
}else{
//是会员
$pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find();
Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$pic['money']+$pic['price']]);
}
}
foreach ($pic_id as $key => $v){
$pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find();
... ...