作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

调试提现

... ... @@ -2,6 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="309ad746-5b2a-4c29-af46-e7925a35765c" name="默认的" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
... ... @@ -49,8 +50,8 @@
<file leaf-file-name="UserMoneyLogAudit.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="453">
<caret line="155" column="35" selection-start-line="155" selection-start-column="35" selection-end-line="155" selection-end-column="35" />
<state relative-caret-position="504">
<caret line="130" column="25" lean-forward="true" selection-start-line="130" selection-start-column="25" selection-end-line="130" selection-end-column="25" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
... ... @@ -61,8 +62,8 @@
<file leaf-file-name="wechat.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="595">
<caret line="50" column="18" selection-start-line="50" selection-start-column="9" selection-end-line="50" selection-end-column="18" />
<state relative-caret-position="833">
<caret line="49" column="65" selection-start-line="49" selection-start-column="65" selection-end-line="49" selection-end-column="65" />
</state>
</provider>
</entry>
... ... @@ -131,7 +132,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/application/home/controller/Upload.php" />
<option value="$PROJECT_DIR$/application/home/controller/Share.php" />
<option value="$PROJECT_DIR$/application/home/controller/Member.php" />
<option value="$PROJECT_DIR$/.gitlab-ci.yml" />
... ... @@ -181,6 +181,7 @@
<option value="$PROJECT_DIR$/public/assets/js/backend/user_money_log_audit.js" />
<option value="$PROJECT_DIR$/application/admin/view/user_money_log_audit/edit.html" />
<option value="$PROJECT_DIR$/application/admin/controller/PayView.php" />
<option value="$PROJECT_DIR$/application/extra/wechat.php" />
<option value="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" />
</list>
</option>
... ... @@ -266,6 +267,17 @@
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="extra" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
</path>
<path>
... ... @@ -336,7 +348,7 @@
<workItem from="1572087949120" duration="1641000" />
<workItem from="1572223206994" duration="28857000" />
<workItem from="1572309778506" duration="26117000" />
<workItem from="1572395935540" duration="9942000" />
<workItem from="1572395935540" duration="10986000" />
</task>
<task id="LOCAL-00001" summary="数据库配置">
<created>1571972429395</created>
... ... @@ -548,11 +560,32 @@
<option name="project" value="LOCAL" />
<updated>1572416100217</updated>
</task>
<option name="localTasksCounter" value="31" />
<task id="LOCAL-00031" summary="调试提现">
<created>1572416152695</created>
<option name="number" value="00031" />
<option name="presentableId" value="LOCAL-00031" />
<option name="project" value="LOCAL" />
<updated>1572416152695</updated>
</task>
<task id="LOCAL-00032" summary="调试提现">
<created>1572416234275</created>
<option name="number" value="00032" />
<option name="presentableId" value="LOCAL-00032" />
<option name="project" value="LOCAL" />
<updated>1572416234275</updated>
</task>
<task id="LOCAL-00033" summary="调试提现">
<created>1572416277819</created>
<option name="number" value="00033" />
<option name="presentableId" value="LOCAL-00033" />
<option name="project" value="LOCAL" />
<updated>1572416277819</updated>
</task>
<option name="localTasksCounter" value="34" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="195167000" />
<option name="totallyTimeSpent" value="196211000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
... ... @@ -936,13 +969,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="595">
<caret line="50" column="18" selection-start-line="50" selection-start-column="9" selection-end-line="50" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/user_money_log.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
... ... @@ -964,10 +990,17 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="833">
<caret line="49" column="65" selection-start-line="49" selection-start-column="65" selection-end-line="49" selection-end-column="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="453">
<caret line="155" column="35" selection-start-line="155" selection-start-column="35" selection-end-line="155" selection-end-column="35" />
<state relative-caret-position="504">
<caret line="130" column="25" lean-forward="true" selection-start-line="130" selection-start-column="25" selection-end-line="130" selection-end-column="25" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
... ...
... ... @@ -111,24 +111,33 @@ class UserMoneyLogAudit extends Backend
if(empty($params['type'])){
$this->error("请选择审核状态");
}
// $result = $row->allowField(true)->save($params);
$admin = Db::name('admin')->where(['id'=>$row['admin_id']])->find();
if($params['type'] == 2){
//审核通过
$admin = Db::name('admin')->where(['id'=>$row['admin_id']])->find();
$user = Db::name('user')->where(['id'=>$admin['user_id']])->find();
$third = Db::name('third')->where(['user_id'=>$admin['user_id']])->find();
//红包券充值比例
$exp_ratio = Db::name('exp_ratio')->where(['id'=>1])->find();
$withdraw = $this->merchantPay($third['openid'],$user['nickname'],$row['money']*$exp_ratio['ratio']*0.01,'商户提现');
dump($withdraw);
if($withdraw['return_code'] == 'SUCCESS') {
if ($withdraw['result_code'] == 'SUCCESS') {
// 提现成功,将余额扣除
// 提现成功
}else{
$this->error($withdraw['err_code_des']);
}
}else{
$this->error($withdraw['return_msg']);
}
}else if($params['type'] == 3){
//审核失败,返还红包券
$result1 = Db::name('admin')->where(['id'=>$row['admin_id']])->setInc('money',$row['money']);
if(empty($result1)){
Db::rollback();
$this->error('sql执行失败');
}
}
exit();
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
... ... @@ -154,7 +163,6 @@ class UserMoneyLogAudit extends Backend
public function merchantPay($openid,$user_name,$price,$desc){
$options = config('wechat');
dump($options);
$app = new Application($options);
$merchantPay = $app->merchant_pay;
$merchantPayData = [
... ...