user = $user; $this->other = $other; } /** * 直接推荐成单 * @Author: * @Date:2018-11-05T13:21:47+0800 * @return [type] [description] */ public function fire() { $this->config = config('rulong_bonus.Settlement.Direct'); $this->strLine = $this->user->relation->bloodline; $this->source['user_id'] = $this->user->id; if (!is_null($this->other)) { $this->source = array_merge($this->source, $this->other); } $order = Order::find($this->source['orderid']); if ($order->profit != 1) { $this->bloodLine = self::getUpBloodLine($this->user, $this->config['layer']); //获取上级血缘线 foreach ($this->bloodLine as $key => $userRelation) { //见点 $userFire = User::find($userRelation->user_id); if ($userFire && $userFire->identity->identity_id > 0) { $this->source['layer'] = $this->user->relation->layer - $userRelation->layer; $userFire->rule('Point', $this->config['point'][$this->source['layer']], false, $this->source); } } $this->user->direct = 1; $this->user->save(); $order->profit = 1; $order->save(); } return true; } }