order = $order; $this->other = $other; $this->bonus = $bonus; } /** * 直接推荐成单 * @Date:2018-11-05T13:21:47+0800 * @return [type] [description] */ public function fire() { $user = $this->order->user; $price = 0; $source['user_id'] = $user->id; $source['orderid'] = $this->order->orderid; if (!is_null($this->other)) { $source = array_merge($source, $this->other); } $user = UserIdentity::where('identity_id', 6)->first(); if ($user) { $parent = $user->user; $proportion = $parent->identity->info->configs['Agent'] ?? 0; if ($proportion > 0) { //确实享受佣金 $price = (int) $this->order->amount * $proportion / 100 - $this->bonus->settlement->ref_price; if ($price > 0) { $parent->rule('Agent', $price, false, $source); return true; } return false; } return false; } else { return false; } } }