Merge pull request 'preview' (#12) from preview into master

Reviewed-on: #12
This commit is contained in:
mkm 2023-09-25 10:55:15 +08:00
commit 8453920dcd
10 changed files with 68 additions and 13 deletions

View File

@ -116,7 +116,7 @@ class MerchantIntentionRepository extends BaseRepository
$margin = app()->make(MerchantTypeRepository::class)->get($intention['mer_type_id']);
$data['is_margin'] = $margin['is_margin'] ?? -1;
$data['margin'] = $margin['margin'] ?? 0;
$data['margin'] = 0;
$merData = [];
if ($create) {
$password = substr($intention['phone'], -6);
@ -137,7 +137,10 @@ class MerchantIntentionRepository extends BaseRepository
'is_bro_goods' => $config['broadcast_goods_type'] == 1 ? 0 : 1,
'mer_password' => $password,
'is_margin' => $margin['is_margin'] ?? -1,
'margin' => $margin['margin'] ?? 0,
// 用户需缴纳保证金
'recharge_margin' => $margin['margin'] ?? 0,
// 用户已缴纳保证金
'margin' => 0,
'uid' => $intention['uid'],
'reg_admin_id' => $autoCreate ? 0: request()->adminId(),
'mer_intention_id' => $id

View File

@ -14,17 +14,22 @@ class paySuccessMargin
public function handle($event)
{
Log::info('微信支付保证金成功回调' . json_encode($event));
$this->event = $event;
$order_sn = $event['order_sn'] ?? '';
$marginInfo = Db::name('margin_order')->where('order_sn', $order_sn)->find();
Db::name('margin_order')->where('order_sn', $order_sn)->update([
'paid' => 1,
'pay_time' => date('Y-m-d H:i:s')
]);
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
'is_margin' => 10
]);
Db::transaction(function () use ($event) {
$order_sn = $event['order_sn'] ?? '';
$marginInfo = Db::name('margin_order')->where('order_sn', $order_sn)->find();
Db::name('margin_order')->where('order_sn', $order_sn)->update([
'paid' => 1,
'pay_time' => date('Y-m-d H:i:s')
]);
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->inc('margin',$marginInfo['total_price']);
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->dec('recharge_margin',$marginInfo['total_price']);
$merchantInfo = Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->find();
if ($merchantInfo['recharge_margin'] <= 0) {
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
'is_margin' => 10
]);
}
});
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.box-container[data-v-abd0a7d6]{overflow:hidden}.box-container .list[data-v-abd0a7d6]{float:left;line-height:40px}.box-container .sp[data-v-abd0a7d6]{width:50%}.box-container .sp3[data-v-abd0a7d6]{width:33.3333%}.box-container .sp100[data-v-abd0a7d6]{width:100%}.box-container .list .name[data-v-abd0a7d6]{display:inline-block;width:150px;text-align:right;color:#606266}.box-container .list.image[data-v-abd0a7d6]{margin-bottom:40px}.box-container .list.image img[data-v-abd0a7d6]{position:relative;top:40px}[data-v-abd0a7d6] .el-form-item__content .el-rate{position:relative;top:8px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long