withdrawModel = $event->getWithdrawModel(); if ($this->awardStatus()) { $this->awardPoint(); } } private function awardPoint() { $data = [ 'point_income_type' => PointService::POINT_INCOME_GET, 'point_mode' => PointService::POINT_INCOME_WITHDRAW_AWARD, 'member_id' => $this->withdrawModel->member_id, 'point' => $this->withdrawModel->actual_poundage, 'remark' => "收入提现奖励消费积分[ID:{$this->withdrawModel->id}]", ]; (new PointService($data))->changePoint(); } /** * 收入提现,奖励比例积分 * * @param WithdrawPayedEvent $event */ public function awardScale($event) { $this->withdrawModel = $event->getWithdrawModel(); if ($this->awardScaleStatus()) { $this->awardScalePoint(); } } private function awardScalePoint() { $scale_point = Setting::get('point.set.income_withdraw_award_scale_point'); \Log::info('积分设置比例',$scale_point); if($scale_point){ $amounts = round((($scale_point * ($this->withdrawModel->actual_amounts+$this->withdrawModel->actual_poundage+$this->withdrawModel->actual_servicetax))/100),2).'%'; $data = [ 'point_income_type' => PointService::POINT_INCOME_GET, 'point_mode' => PointService::POINT_INCOME_WITHDRAW_AWARD_SCALE, 'member_id' => $this->withdrawModel->member_id, 'point' => $amounts, 'remark' => "收入提现奖励比例消费积分[ID:{$this->withdrawModel->id}]", ]; (new PointService($data))->changePoint(); } } private function awardStatus() { return !!Setting::get('point.set.income_withdraw_award'); } private function awardScaleStatus() { return !!Setting::get('point.set.income_withdraw_award_scale'); } }