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

修改服务费

... ... @@ -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$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/SubscribeController.php" afterPath="$PROJECT_DIR$/api/index/controller/SubscribeController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/UserController.php" afterPath="$PROJECT_DIR$/api/index/controller/UserController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
... ... @@ -24,12 +25,12 @@
<select />
</component>
<component name="FileEditorManager">
<leaf>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
<caret line="647" column="52" lean-forward="true" selection-start-line="647" selection-start-column="52" selection-end-line="647" selection-end-column="52" />
<state relative-caret-position="817">
<caret line="1007" column="7" lean-forward="true" selection-start-line="1007" selection-start-column="7" selection-end-line="1007" selection-end-column="7" />
<folding>
<element signature="e#366#791#0#PHP" expanded="false" />
<element signature="e#796#1608#0#PHP" expanded="false" />
... ... @@ -55,46 +56,48 @@
<element signature="e#11571#11859#0#PHP" expanded="false" />
<element signature="e#11864#12803#0#PHP" expanded="false" />
<element signature="e#12809#13390#0#PHP" expanded="false" />
<element signature="e#13395#15019#0#PHP" expanded="false" />
<element signature="e#15025#15481#0#PHP" expanded="false" />
<element signature="e#15486#17554#0#PHP" expanded="false" />
<element signature="e#17577#17932#0#PHP" expanded="false" />
<element signature="e#20143#20604#0#PHP" expanded="false" />
<element signature="e#20609#23736#0#PHP" expanded="false" />
<element signature="e#23742#24351#0#PHP" expanded="false" />
<element signature="e#24356#25641#0#PHP" expanded="false" />
<element signature="e#25647#26004#0#PHP" expanded="false" />
<element signature="e#26009#26992#0#PHP" expanded="false" />
<element signature="e#26998#27350#0#PHP" expanded="false" />
<element signature="e#27355#28464#0#PHP" expanded="false" />
<element signature="e#28470#28825#0#PHP" expanded="false" />
<element signature="e#28830#30257#0#PHP" expanded="false" />
<element signature="e#30263#30687#0#PHP" expanded="false" />
<element signature="e#30692#31303#0#PHP" expanded="false" />
<element signature="e#31309#31805#0#PHP" expanded="false" />
<element signature="e#31810#35521#0#PHP" expanded="false" />
<element signature="e#32612#33739#0#PHP" expanded="false" />
<element signature="e#35527#35811#0#PHP" expanded="false" />
<element signature="e#35816#36452#0#PHP" expanded="false" />
<element signature="e#36473#36792#0#PHP" expanded="false" />
<element signature="e#36798#37206#0#PHP" expanded="false" />
<element signature="e#37212#37971#0#PHP" expanded="false" />
<element signature="e#37990#38854#0#PHP" expanded="false" />
<element signature="e#38880#39280#0#PHP" expanded="false" />
<element signature="e#39303#39876#0#PHP" expanded="false" />
<element signature="e#39899#40709#0#PHP" expanded="false" />
<element signature="e#40715#41314#0#PHP" expanded="false" />
<element signature="e#41319#42283#0#PHP" expanded="false" />
<element signature="e#42289#42956#0#PHP" expanded="false" />
<element signature="e#42961#44002#0#PHP" expanded="false" />
<element signature="e#44008#44671#0#PHP" expanded="false" />
<element signature="e#44676#45703#0#PHP" expanded="false" />
<element signature="e#45710#46141#0#PHP" expanded="false" />
<element signature="e#46146#46724#0#PHP" expanded="false" />
<element signature="e#46730#47159#0#PHP" expanded="false" />
<element signature="e#47164#47766#0#PHP" expanded="false" />
<element signature="e#47772#48199#0#PHP" expanded="false" />
<element signature="e#48204#48770#0#PHP" expanded="false" />
<element signature="e#13395#14945#0#PHP" expanded="false" />
<element signature="e#14951#15407#0#PHP" expanded="false" />
<element signature="e#15412#17480#0#PHP" expanded="false" />
<element signature="e#17503#17858#0#PHP" expanded="false" />
<element signature="e#17864#18605#0#PHP" expanded="false" />
<element signature="e#18610#20063#0#PHP" expanded="false" />
<element signature="e#20069#20530#0#PHP" expanded="false" />
<element signature="e#20535#23662#0#PHP" expanded="false" />
<element signature="e#23668#24277#0#PHP" expanded="false" />
<element signature="e#24282#25567#0#PHP" expanded="false" />
<element signature="e#25573#25930#0#PHP" expanded="false" />
<element signature="e#25935#26918#0#PHP" expanded="false" />
<element signature="e#26924#27276#0#PHP" expanded="false" />
<element signature="e#27281#28390#0#PHP" expanded="false" />
<element signature="e#28396#28751#0#PHP" expanded="false" />
<element signature="e#28756#30183#0#PHP" expanded="false" />
<element signature="e#30189#30613#0#PHP" expanded="false" />
<element signature="e#30618#31229#0#PHP" expanded="false" />
<element signature="e#31235#31731#0#PHP" expanded="false" />
<element signature="e#31736#35383#0#PHP" expanded="false" />
<element signature="e#32538#33665#0#PHP" expanded="false" />
<element signature="e#35389#35673#0#PHP" expanded="false" />
<element signature="e#35678#36314#0#PHP" expanded="false" />
<element signature="e#36335#36654#0#PHP" expanded="false" />
<element signature="e#36660#37068#0#PHP" expanded="false" />
<element signature="e#37074#37833#0#PHP" expanded="false" />
<element signature="e#37852#38716#0#PHP" expanded="false" />
<element signature="e#38742#39142#0#PHP" expanded="false" />
<element signature="e#39165#39738#0#PHP" expanded="false" />
<element signature="e#39761#40571#0#PHP" expanded="false" />
<element signature="e#40577#41176#0#PHP" expanded="false" />
<element signature="e#41181#42145#0#PHP" expanded="false" />
<element signature="e#42151#42818#0#PHP" expanded="false" />
<element signature="e#42823#43864#0#PHP" expanded="false" />
<element signature="e#43870#44533#0#PHP" expanded="false" />
<element signature="e#44538#45565#0#PHP" expanded="false" />
<element signature="e#45572#46003#0#PHP" expanded="false" />
<element signature="e#46008#46586#0#PHP" expanded="false" />
<element signature="e#46592#47021#0#PHP" expanded="false" />
<element signature="e#47026#47628#0#PHP" expanded="false" />
<element signature="e#47634#48061#0#PHP" expanded="false" />
<element signature="e#48066#48632#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -155,7 +158,6 @@
<option value="$PROJECT_DIR$/app/admin/controller/FeeController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/bounty/index.html" />
<option value="$PROJECT_DIR$/app/admin/controller/BountyController.php" />
<option value="$PROJECT_DIR$/api/index/controller/SubscribeController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/point/add.html" />
<option value="$PROJECT_DIR$/api/index/controller/RecycleController.php" />
<option value="$PROJECT_DIR$/api/index/controller/HomeController.php" />
... ... @@ -170,6 +172,7 @@
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/index.html" />
<option value="$PROJECT_DIR$/app/user/controller/AdminIndexController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/jifendetail.html" />
<option value="$PROJECT_DIR$/api/index/controller/SubscribeController.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
</list>
</option>
... ... @@ -188,9 +191,9 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="274" />
<option name="y" value="97" />
<component name="ProjectFrameBounds">
<option name="x" value="249" />
<option name="y" value="26" />
<option name="width" value="1618" />
<option name="height" value="1096" />
</component>
... ... @@ -356,18 +359,19 @@
<workItem from="1576215244804" duration="6841000" />
<workItem from="1576298110450" duration="8414000" />
<workItem from="1576455946584" duration="1141000" />
<workItem from="1576459063836" duration="216000" />
<workItem from="1576459063836" duration="389000" />
<workItem from="1576463908857" duration="935000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="573859000" />
<option name="totallyTimeSpent" value="574967000" />
</component>
<component name="ToolWindowManager">
<frame x="274" y="97" width="1618" height="1096" extended-state="1" />
<frame x="249" y="26" width="1618" height="1096" extended-state="0" />
<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.19383825" 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.19640565" 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" />
... ... @@ -642,13 +646,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SubscribeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="25">
<caret line="1" column="0" lean-forward="false" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
</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="127">
... ... @@ -792,10 +789,28 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SubscribeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<folding>
<element signature="e#305#577#0#PHP" expanded="false" />
<element signature="e#583#854#0#PHP" expanded="false" />
<element signature="e#859#1113#0#PHP" expanded="false" />
<element signature="e#1119#1594#0#PHP" expanded="false" />
<element signature="e#1599#2490#0#PHP" expanded="false" />
<element signature="e#2497#2911#0#PHP" expanded="false" />
<element signature="e#2916#3386#0#PHP" expanded="false" />
<element signature="e#3393#3889#0#PHP" expanded="false" />
<element signature="e#3894#5028#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
<caret line="647" column="52" lean-forward="true" selection-start-line="647" selection-start-column="52" selection-end-line="647" selection-end-column="52" />
<state relative-caret-position="817">
<caret line="1007" column="7" lean-forward="true" selection-start-line="1007" selection-start-column="7" selection-end-line="1007" selection-end-column="7" />
<folding>
<element signature="e#366#791#0#PHP" expanded="false" />
<element signature="e#796#1608#0#PHP" expanded="false" />
... ... @@ -821,46 +836,48 @@
<element signature="e#11571#11859#0#PHP" expanded="false" />
<element signature="e#11864#12803#0#PHP" expanded="false" />
<element signature="e#12809#13390#0#PHP" expanded="false" />
<element signature="e#13395#15019#0#PHP" expanded="false" />
<element signature="e#15025#15481#0#PHP" expanded="false" />
<element signature="e#15486#17554#0#PHP" expanded="false" />
<element signature="e#17577#17932#0#PHP" expanded="false" />
<element signature="e#20143#20604#0#PHP" expanded="false" />
<element signature="e#20609#23736#0#PHP" expanded="false" />
<element signature="e#23742#24351#0#PHP" expanded="false" />
<element signature="e#24356#25641#0#PHP" expanded="false" />
<element signature="e#25647#26004#0#PHP" expanded="false" />
<element signature="e#26009#26992#0#PHP" expanded="false" />
<element signature="e#26998#27350#0#PHP" expanded="false" />
<element signature="e#27355#28464#0#PHP" expanded="false" />
<element signature="e#28470#28825#0#PHP" expanded="false" />
<element signature="e#28830#30257#0#PHP" expanded="false" />
<element signature="e#30263#30687#0#PHP" expanded="false" />
<element signature="e#30692#31303#0#PHP" expanded="false" />
<element signature="e#31309#31805#0#PHP" expanded="false" />
<element signature="e#31810#35521#0#PHP" expanded="false" />
<element signature="e#32612#33739#0#PHP" expanded="false" />
<element signature="e#35527#35811#0#PHP" expanded="false" />
<element signature="e#35816#36452#0#PHP" expanded="false" />
<element signature="e#36473#36792#0#PHP" expanded="false" />
<element signature="e#36798#37206#0#PHP" expanded="false" />
<element signature="e#37212#37971#0#PHP" expanded="false" />
<element signature="e#37990#38854#0#PHP" expanded="false" />
<element signature="e#38880#39280#0#PHP" expanded="false" />
<element signature="e#39303#39876#0#PHP" expanded="false" />
<element signature="e#39899#40709#0#PHP" expanded="false" />
<element signature="e#40715#41314#0#PHP" expanded="false" />
<element signature="e#41319#42283#0#PHP" expanded="false" />
<element signature="e#42289#42956#0#PHP" expanded="false" />
<element signature="e#42961#44002#0#PHP" expanded="false" />
<element signature="e#44008#44671#0#PHP" expanded="false" />
<element signature="e#44676#45703#0#PHP" expanded="false" />
<element signature="e#45710#46141#0#PHP" expanded="false" />
<element signature="e#46146#46724#0#PHP" expanded="false" />
<element signature="e#46730#47159#0#PHP" expanded="false" />
<element signature="e#47164#47766#0#PHP" expanded="false" />
<element signature="e#47772#48199#0#PHP" expanded="false" />
<element signature="e#48204#48770#0#PHP" expanded="false" />
<element signature="e#13395#14945#0#PHP" expanded="false" />
<element signature="e#14951#15407#0#PHP" expanded="false" />
<element signature="e#15412#17480#0#PHP" expanded="false" />
<element signature="e#17503#17858#0#PHP" expanded="false" />
<element signature="e#17864#18605#0#PHP" expanded="false" />
<element signature="e#18610#20063#0#PHP" expanded="false" />
<element signature="e#20069#20530#0#PHP" expanded="false" />
<element signature="e#20535#23662#0#PHP" expanded="false" />
<element signature="e#23668#24277#0#PHP" expanded="false" />
<element signature="e#24282#25567#0#PHP" expanded="false" />
<element signature="e#25573#25930#0#PHP" expanded="false" />
<element signature="e#25935#26918#0#PHP" expanded="false" />
<element signature="e#26924#27276#0#PHP" expanded="false" />
<element signature="e#27281#28390#0#PHP" expanded="false" />
<element signature="e#28396#28751#0#PHP" expanded="false" />
<element signature="e#28756#30183#0#PHP" expanded="false" />
<element signature="e#30189#30613#0#PHP" expanded="false" />
<element signature="e#30618#31229#0#PHP" expanded="false" />
<element signature="e#31235#31731#0#PHP" expanded="false" />
<element signature="e#31736#35383#0#PHP" expanded="false" />
<element signature="e#32538#33665#0#PHP" expanded="false" />
<element signature="e#35389#35673#0#PHP" expanded="false" />
<element signature="e#35678#36314#0#PHP" expanded="false" />
<element signature="e#36335#36654#0#PHP" expanded="false" />
<element signature="e#36660#37068#0#PHP" expanded="false" />
<element signature="e#37074#37833#0#PHP" expanded="false" />
<element signature="e#37852#38716#0#PHP" expanded="false" />
<element signature="e#38742#39142#0#PHP" expanded="false" />
<element signature="e#39165#39738#0#PHP" expanded="false" />
<element signature="e#39761#40571#0#PHP" expanded="false" />
<element signature="e#40577#41176#0#PHP" expanded="false" />
<element signature="e#41181#42145#0#PHP" expanded="false" />
<element signature="e#42151#42818#0#PHP" expanded="false" />
<element signature="e#42823#43864#0#PHP" expanded="false" />
<element signature="e#43870#44533#0#PHP" expanded="false" />
<element signature="e#44538#45565#0#PHP" expanded="false" />
<element signature="e#45572#46003#0#PHP" expanded="false" />
<element signature="e#46008#46586#0#PHP" expanded="false" />
<element signature="e#46592#47021#0#PHP" expanded="false" />
<element signature="e#47026#47628#0#PHP" expanded="false" />
<element signature="e#47634#48061#0#PHP" expanded="false" />
<element signature="e#48066#48632#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -175,6 +175,10 @@ class SubscribeController extends RestBaseController
if (!$validate->check($param)) {
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
}
$fee = Db::name('recyclefee')
->where('id',1)
->find();
$param['fee_money'] = $fee['fee'];
$param['num'] = cmf_get_order_sn();
$data = Db::name('subscribe')
->insert($param);
... ...
... ... @@ -497,10 +497,9 @@ class UserController extends RestBaseController
$data['sub_time'] = $res['sub_time'];
$data['image'] = explode(',',$res['image']);
$data['content'] = cmf_replace_content_file_url(htmlspecialchars_decode($res['content']));
$serve = Db::name('recyclefee')->where('id',1)->field('fee')->find();
$data['status'] = $res['status'];
if($data['status'] == 1 || $data['status'] == 0){
$data['serve'] = $serve['fee'];
$data['serve'] = $res['fee_money'];
}else{
$data['serve'] = $res['fee'];
$data['get_integral'] = $res['get_integral']-$data['serve'];
... ... @@ -1061,16 +1060,11 @@ class UserController extends RestBaseController
Db::name('detail')->insertGetId($ji);
}
}
//添加对应的积分明细
$detail['user_id'] = $order['user_id'];
//判断是否存在服务费
$fee = Db::name('recyclefee')
->where('id',1)
->find();
if($fee['fee'] == 0){
if(empty($order['fee_money'])){
//没有服务费
$detail['total'] = $get_integral;
$sub['fee'] = 0;
... ... @@ -1079,8 +1073,8 @@ class UserController extends RestBaseController
$res['now_integral'] = $info['now_integral'] + $get_integral;
}else{
//有服务费
$detail['total'] = $get_integral-($get_integral*($fee['fee']/100));
$sub['fee'] = $get_integral*($fee['fee']/100);
$detail['total'] = $get_integral-($get_integral*($order['fee_money']/100));
$sub['fee'] = $get_integral*($order['fee_money']/100);
$res['num'] = $info['num'] + 1;
$res['add_total'] = $info['add_total'] + ($get_integral - $sub['fee']);
$res['now_integral'] = $info['now_integral'] + ($get_integral - $sub['fee']);
... ...