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

修改支付

... ... @@ -2,7 +2,10 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0011664b-87e9-41bd-9f37-18792fb15777" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/UserController.php" afterPath="$PROJECT_DIR$/api/index/controller/UserController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<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$/simplewind/cmf/common.php" afterPath="$PROJECT_DIR$/simplewind/cmf/common.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" afterPath="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -24,13 +27,16 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="true">
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="453">
<caret line="52" column="44" lean-forward="false" selection-start-line="52" selection-start-column="44" selection-end-line="52" selection-end-column="44" />
<state relative-caret-position="233">
<caret line="37" column="27" lean-forward="false" selection-start-line="37" selection-start-column="27" selection-end-line="37" selection-end-column="27" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1532#0#PHP" expanded="false" />
<element signature="e#1538#1767#0#PHP" expanded="false" />
<element signature="e#1772#3407#0#PHP" expanded="false" />
<element signature="e#3413#3653#0#PHP" expanded="false" />
<element signature="e#3658#3893#0#PHP" expanded="false" />
<element signature="e#3899#4246#0#PHP" expanded="false" />
... ... @@ -98,13 +104,35 @@
<file leaf-file-name="common.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="183">
<caret line="1771" column="9" lean-forward="true" selection-start-line="1771" selection-start-column="9" selection-end-line="1771" selection-end-column="9" />
<state relative-caret-position="802">
<caret line="1850" column="1" lean-forward="false" selection-start-line="1850" selection-start-column="1" selection-end-line="1850" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="427">
<caret line="74" column="0" lean-forward="true" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#336#608#0#PHP" expanded="false" />
<element signature="e#614#976#0#PHP" expanded="false" />
<element signature="e#981#1841#0#PHP" expanded="false" />
<element signature="e#1847#2084#0#PHP" expanded="false" />
<element signature="e#2089#2786#0#PHP" expanded="false" />
<element signature="e#2792#3034#0#PHP" expanded="false" />
<element signature="e#3040#3277#0#PHP" expanded="false" />
<element signature="e#3282#3354#0#PHP" expanded="false" />
<element signature="e#3360#3839#0#PHP" expanded="false" />
<element signature="e#3844#4411#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
... ... @@ -125,7 +153,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/api/index/model/ShoptypeModel.php" />
<option value="$PROJECT_DIR$/api/index/model/ShoppicModel.php" />
<option value="$PROJECT_DIR$/app/admin/controller/BuildController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/money/index.html" />
... ... @@ -169,13 +196,14 @@
<option value="$PROJECT_DIR$/api/index/controller/RecycleController.php" />
<option value="$PROJECT_DIR$/api/index/controller/ShopgoodsController.php" />
<option value="$PROJECT_DIR$/api/index/controller/HomeController.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<option value="$PROJECT_DIR$/app/admin/controller/ShoporderController.php" />
<option value="$PROJECT_DIR$/api/config.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/point/add.html" />
<option value="$PROJECT_DIR$/app/admin/controller/PointController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/common.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
<option value="$PROJECT_DIR$/simplewind/extend/wxapp/pay/WeixinPay.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/common.php" />
</list>
</option>
</component>
... ... @@ -193,11 +221,11 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="396" />
<option name="y" value="104" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="198" />
<option name="y" value="62" />
<option name="width" value="1700" />
<option name="height" value="1030" />
<option name="height" value="1039" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -214,6 +242,8 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
... ... @@ -242,19 +272,36 @@
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simplewind" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simplewind" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="cmf" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simplewind" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="extend" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simplewind" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="extend" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="wxapp" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../areial" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../project/competition" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
</component>
<component name="RecentsManager">
... ... @@ -351,18 +398,19 @@
<workItem from="1575444399653" duration="12810000" />
<workItem from="1575462840839" duration="250000" />
<workItem from="1575506248144" duration="15103000" />
<workItem from="1575527294268" duration="9387000" />
<workItem from="1575527294268" duration="10705000" />
<workItem from="1575543830603" duration="1158000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="491199000" />
<option name="totallyTimeSpent" value="493675000" />
</component>
<component name="ToolWindowManager">
<frame x="396" y="104" width="1700" height="1030" extended-state="0" />
<frame x="198" y="62" width="1700" height="1039" 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.16341463" 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.16524391" 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" />
... ... @@ -628,19 +676,10 @@
</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$/app/admin/controller/HomeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
... ... @@ -681,7 +720,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="158">
<caret line="16" column="77" lean-forward="true" selection-start-line="16" selection-start-column="15" selection-end-line="16" selection-end-column="77" />
<folding />
</state>
</provider>
</entry>
... ... @@ -818,7 +856,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
... ... @@ -826,7 +863,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
... ... @@ -834,7 +870,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1351">
<caret line="235" column="11" lean-forward="true" selection-start-line="235" selection-start-column="11" selection-end-line="235" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
... ... @@ -842,7 +877,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="52" column="36" lean-forward="true" selection-start-line="52" selection-start-column="36" selection-end-line="52" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
... ... @@ -859,25 +893,6 @@
</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="176">
<caret line="17" column="12" lean-forward="true" selection-start-line="17" selection-start-column="12" selection-end-line="17" selection-end-column="12" />
<folding>
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#970#0#PHP" expanded="false" />
<element signature="e#975#1835#0#PHP" expanded="false" />
<element signature="e#1841#2078#0#PHP" expanded="false" />
<element signature="e#2083#2781#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#4406#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="174">
... ... @@ -898,20 +913,31 @@
</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="292">
<caret line="15" column="13" lean-forward="false" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/cmf/common.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="183">
<caret line="1771" column="9" lean-forward="true" selection-start-line="1771" selection-start-column="9" selection-end-line="1771" selection-end-column="9" />
<state relative-caret-position="802">
<caret line="1850" column="1" lean-forward="false" selection-start-line="1850" selection-start-column="1" selection-end-line="1850" selection-end-column="1" />
<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="453">
<caret line="52" column="44" lean-forward="false" selection-start-line="52" selection-start-column="44" selection-end-line="52" selection-end-column="44" />
<state relative-caret-position="233">
<caret line="37" column="27" lean-forward="false" selection-start-line="37" selection-start-column="27" selection-end-line="37" selection-end-column="27" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1532#0#PHP" expanded="false" />
<element signature="e#1538#1767#0#PHP" expanded="false" />
<element signature="e#1772#3407#0#PHP" expanded="false" />
<element signature="e#3413#3653#0#PHP" expanded="false" />
<element signature="e#3658#3893#0#PHP" expanded="false" />
<element signature="e#3899#4246#0#PHP" expanded="false" />
... ... @@ -975,5 +1001,25 @@
</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="427">
<caret line="74" column="0" lean-forward="true" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#336#608#0#PHP" expanded="false" />
<element signature="e#614#976#0#PHP" expanded="false" />
<element signature="e#981#1841#0#PHP" expanded="false" />
<element signature="e#1847#2084#0#PHP" expanded="false" />
<element signature="e#2089#2786#0#PHP" expanded="false" />
<element signature="e#2792#3034#0#PHP" expanded="false" />
<element signature="e#3040#3277#0#PHP" expanded="false" />
<element signature="e#3282#3354#0#PHP" expanded="false" />
<element signature="e#3360#3839#0#PHP" expanded="false" />
<element signature="e#3844#4411#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -12,7 +12,8 @@ namespace api\index\controller;
use api\index\model\OrderModel;
use cmf\controller\RestBaseController;
use think\Db;
use think\Validate;
use wxapp\pay\WeixinPay;
/**
* @title 订单
... ... @@ -97,7 +98,7 @@ class OrderController extends RestBaseController
}
//微信支付
$openid = $this->getOpenid();
$pay = new \WeixinPay();
$pay = new WeixinPay();
$this->success('SUCCESS',$pay->pay($openid['openid'],$data['num'],"废品回收",$data['total'],cmf_api_url('index/pay/notify','','',true)));
}
... ...
... ... @@ -1833,3 +1833,19 @@ function generateCode($length = 6) {
$max = pow(10, $length) - 1;
return rand($min, $max);
}
/**
* CMF Url生成
* @param string $url 路由地址
* @param string|array $vars 变量
* @param bool|string $suffix 生成的URL后缀
* @param bool|string $domain 域名
* @return string
*/
function cmf_api_url($url = '', $vars = '', $suffix = true ,$domain = false){
$newUrl='/api'.url($url, $vars, $suffix);
if($domain){
$newUrl='http://'.$_SERVER['HTTP_HOST'].$newUrl;
}
return $newUrl;
}
... ...
<?php
namespace wxapp\pay;
/*
* 小程序微信支付
*/
... ...