diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ee1221a..40501b9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +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$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/Pay.php" afterPath="$PROJECT_DIR$/application/api/controller/Pay.php" /> </list> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> @@ -16,8 +17,8 @@ <file leaf-file-name="User.php" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="100"> - <caret line="774" column="5" lean-forward="true" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> + <state relative-caret-position="2100"> + <caret line="774" column="5" lean-forward="false" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> <folding> <element signature="e#1233#2896#0#PHP" expanded="false" /> <element signature="e#2902#3430#0#PHP" expanded="false" /> @@ -89,8 +90,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="210"> - <caret line="729" column="21" lean-forward="true" selection-start-line="729" selection-start-column="21" selection-end-line="729" selection-end-column="21" /> + <state relative-caret-position="194"> + <caret line="789" column="26" lean-forward="true" selection-start-line="789" selection-start-column="26" selection-end-line="789" selection-end-column="26" /> <folding> <element signature="e#574#693#0#PHP" expanded="false" /> <element signature="e#699#1012#0#PHP" expanded="false" /> @@ -100,9 +101,9 @@ <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#7772#9181#0#PHP" expanded="false" /> <element signature="e#11546#11997#0#PHP" expanded="false" /> <element signature="e#13212#13330#0#PHP" expanded="false" /> + <element signature="e#14187#15962#0#PHP" expanded="false" /> <element signature="e#16035#16455#0#PHP" expanded="false" /> <element signature="e#16460#26484#0#PHP" expanded="false" /> <element signature="e#18227#19634#0#PHP" expanded="false" /> @@ -113,10 +114,11 @@ <element signature="e#26803#27196#0#PHP" expanded="false" /> <element signature="e#27223#30701#0#PHP" expanded="false" /> <element signature="e#30730#33635#0#PHP" expanded="false" /> - <element signature="e#34685#35992#0#PHP" expanded="false" /> - <element signature="e#36013#39569#0#PHP" expanded="false" /> - <element signature="e#38093#38480#0#PHP" expanded="false" /> - <element signature="e#40209#47381#0#PHP" expanded="false" /> + <element signature="e#34478#35794#0#PHP" expanded="false" /> + <element signature="e#35815#39319#0#PHP" expanded="false" /> + <element signature="e#37893#38280#0#PHP" expanded="false" /> + <element signature="e#38341#39297#0#PHP" expanded="false" /> + <element signature="e#39958#47130#0#PHP" expanded="false" /> </folding> </state> </provider> @@ -209,11 +211,11 @@ <sorting>DEFINITION_ORDER</sorting> </component> <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> - <component name="ProjectFrameBounds"> - <option name="x" value="348" /> - <option name="y" value="38" /> + <component name="ProjectFrameBounds" extendedState="1"> + <option name="x" value="2" /> + <option name="y" value="11" /> <option name="width" value="1871" /> - <option name="height" value="997" /> + <option name="height" value="996" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> @@ -230,6 +232,7 @@ <foldersAlwaysOnTop value="true" /> </navigator> <panes> + <pane id="Scope" /> <pane id="Scratches" /> <pane id="ProjectPane"> <subPane> @@ -285,7 +288,6 @@ <select /> </subPane> </pane> - <pane id="Scope" /> </panes> </component> <component name="PropertiesComponent"> @@ -367,7 +369,8 @@ <workItem from="1575592025964" duration="640000" /> <workItem from="1575599624364" duration="95000" /> <workItem from="1575680867057" duration="23412000" /> - <workItem from="1575708184460" duration="1675000" /> + <workItem from="1575708184460" duration="1768000" /> + <workItem from="1575771325770" duration="637000" /> </task> <task id="LOCAL-00001" summary="调试"> <created>1574145133364</created> @@ -380,7 +383,7 @@ <servers /> </component> <component name="TimeTrackingManager"> - <option name="totallyTimeSpent" value="334986000" /> + <option name="totallyTimeSpent" value="335716000" /> </component> <component name="TodoView"> <todo-panel id="selected-file"> @@ -392,10 +395,10 @@ </todo-panel> </component> <component name="ToolWindowManager"> - <frame x="348" y="38" width="1871" height="997" extended-state="0" /> + <frame x="2" y="11" width="1871" height="996" 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.1722805" 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.17393705" 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" /> @@ -790,8 +793,8 @@ </entry> <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="100"> - <caret line="774" column="5" lean-forward="true" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> + <state relative-caret-position="2100"> + <caret line="774" column="5" lean-forward="false" selection-start-line="774" selection-start-column="5" selection-end-line="774" selection-end-column="5" /> <folding> <element signature="e#1233#2896#0#PHP" expanded="false" /> <element signature="e#2902#3430#0#PHP" expanded="false" /> @@ -861,8 +864,8 @@ </entry> <entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php"> <provider selected="true" editor-type-id="text-editor"> - <state relative-caret-position="210"> - <caret line="729" column="21" lean-forward="true" selection-start-line="729" selection-start-column="21" selection-end-line="729" selection-end-column="21" /> + <state relative-caret-position="194"> + <caret line="789" column="26" lean-forward="true" selection-start-line="789" selection-start-column="26" selection-end-line="789" selection-end-column="26" /> <folding> <element signature="e#574#693#0#PHP" expanded="false" /> <element signature="e#699#1012#0#PHP" expanded="false" /> @@ -872,9 +875,9 @@ <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#7772#9181#0#PHP" expanded="false" /> <element signature="e#11546#11997#0#PHP" expanded="false" /> <element signature="e#13212#13330#0#PHP" expanded="false" /> + <element signature="e#14187#15962#0#PHP" expanded="false" /> <element signature="e#16035#16455#0#PHP" expanded="false" /> <element signature="e#16460#26484#0#PHP" expanded="false" /> <element signature="e#18227#19634#0#PHP" expanded="false" /> @@ -885,10 +888,11 @@ <element signature="e#26803#27196#0#PHP" expanded="false" /> <element signature="e#27223#30701#0#PHP" expanded="false" /> <element signature="e#30730#33635#0#PHP" expanded="false" /> - <element signature="e#34685#35992#0#PHP" expanded="false" /> - <element signature="e#36013#39569#0#PHP" expanded="false" /> - <element signature="e#38093#38480#0#PHP" expanded="false" /> - <element signature="e#40209#47381#0#PHP" expanded="false" /> + <element signature="e#34478#35794#0#PHP" expanded="false" /> + <element signature="e#35815#39319#0#PHP" expanded="false" /> + <element signature="e#37893#38280#0#PHP" expanded="false" /> + <element signature="e#38341#39297#0#PHP" expanded="false" /> + <element signature="e#39958#47130#0#PHP" expanded="false" /> </folding> </state> </provider> diff --git a/application/api/controller/Pay.php b/application/api/controller/Pay.php index 19d93dc..95bb1e2 100644 --- a/application/api/controller/Pay.php +++ b/application/api/controller/Pay.php @@ -702,18 +702,14 @@ class Pay extends Api $user = Db::name('user')->where('id',$data['user_id'])->find(); $mobile = $user['mobile']; $str = "【仁甲看见】"; - $uid = $this->uid; - $login = Db::name('user') - ->where('id',$uid) - ->field('id,is_vip') - ->find(); - if(!empty($pic_id)){ + if(empty($pic_id)){ //将购买次数加1 foreach ($pic_id as $key => $v){ //非会员 - if($login['is_vip'] == 0){ + if($user['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']]); + $total_money = $pic['money']+$pic['price']; + Db::name('pic')->where('id',$pic['id'])->update(['buy_num'=>$pic['buy_num']+1,'money'=>$total_money]); }else{ //是会员 $pic = Db::name('pic')->field('id,price,buy_num,money')->where('id',$v)->find(); @@ -726,11 +722,10 @@ class Pay extends Api $pic = Db::name('pic')->field('id,title,url,code')->where('id',$v)->find(); $str .= "图片标题:$pic[title],云盘地址:$pic[url],提取码:$pic[code],"; } - $toporder['status'] = 30; } - if(!empty($video_id)){ + if(empty($video_id)){ //判断是否为会员 - if($login['is_vip'] == 0){ + if($user['is_vip'] == 0){ //不是会员的情况 //将购买次数加1 foreach ($video_id as $key => $val){ @@ -783,14 +778,13 @@ class Pay extends Api $str .= "视频标题:$video[title],云盘地址:$video[eight_url],提取码:$video[eight_code]"; } } - $toporder['status'] = 40; } //发送短信 if(!empty($mobile)){ $result = $this->sms($mobile,$str); } //支付成功,更新订单状态 - $toporder['status'] = 20; + $toporder['status'] = 2; $toporder['paytime'] = time(); }else{ //支付失败