| | |
| | | use app\common\enum\user\balanceLog\BalanceLogSceneEnum; |
| | | use app\common\model\user\BalanceLog as BalanceLogModel; |
| | | use app\common\service\BaseService; |
| | | use app\common\model\plus\business\Business as BusinessModel; |
| | | use app\common\model\plus\business\Setting as SettingModel; |
| | | |
| | | /** |
| | | * 名片订单支付成功后的回调 |
| | |
| | | $this->user->setIncPayMoney($this->model['pay_price']); |
| | | // 记录订单支付信息 |
| | | $this->updatePayInfo($payType); |
| | | // 如果是置顶订单,更新名片置顶状态 |
| | | if ($this->model['order_source'] == 20) { |
| | | $this->updateBusinessCardTopStatus(); |
| | | } |
| | | }); |
| | | return true; |
| | | } |
| | |
| | | ], ['order_no' => $this->model['order_no']]); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 更新名片置顶状态 |
| | | */ |
| | | private function updateBusinessCardTopStatus() |
| | | { |
| | | // 获取置顶设置 |
| | | $setting = SettingModel::getItem('basic'); |
| | | $topDays = isset($setting['top_days']) ? $setting['top_days'] : 7; // 默认7天 |
| | | |
| | | // 计算置顶到期时间 |
| | | $topTime = time() + ($topDays * 86400); |
| | | |
| | | // 更新名片置顶状态 |
| | | $businessCard = BusinessModel::detail($this->model['business_card_id']); |
| | | if ($businessCard) { |
| | | $businessCard->save([ |
| | | 'is_top' => 1, |
| | | 'top_time' => $topTime |
| | | ]); |
| | | } |
| | | } |
| | | } |