| | |
| | | protected $pk = 'shop_supplier_id'; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关联应用表 |
| | | */ |
| | |
| | | { |
| | | $this->save(['money' => $this['money'] - $money,'freeze_money'=>$this['freeze_money']+$money]); |
| | | } |
| | | /** |
| | | * 直推供应商多少人 |
| | | */ |
| | | public function refereeSupplierCount ($referee_id) |
| | | { |
| | | $count = $this->where('referee_id', '=', $referee_id) |
| | | ->where('is_delete', '=', 0) |
| | | ->count(); |
| | | return $count; |
| | | } |
| | | |
| | | /** |
| | | * 下级商户数量 |
| | | * @param $user_id |
| | | * @return int |
| | | */ |
| | | public function getSubordinateNum($user_id) |
| | | { |
| | | return (new static())->where('is_delete', '=', 0) |
| | | ->where('referee_id', 'in', $user_id) |
| | | ->count(); |
| | | } |
| | | |
| | | } |