|
|
@@ -497,13 +497,23 @@ class User extends BaseModel
|
|
|
* @return bool|int|string
|
|
|
*/
|
|
|
public static function getSpreadLevelCount($uid = 0)
|
|
|
+ {
|
|
|
+ $group_users = \app\admin\model\user\User::get_group_user($uid);
|
|
|
+ $achievement1 = \app\admin\model\order\StoreOrder::where('uid','in', $group_users)->where('paid', 1)->whereNotIn('status',-1)->sum('pay_price');
|
|
|
+ return $achievement1;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * TODO 团队业绩
|
|
|
+ * @param int $uid
|
|
|
+ * @return bool|int|string
|
|
|
+ */
|
|
|
+ public static function getTeamPerformance($uid = 0)
|
|
|
{
|
|
|
if (!$uid) return false;
|
|
|
$uidSubordinate = self::where('spread_uid', $uid)->column('uid');
|
|
|
if (!count($uidSubordinate)) return 0;
|
|
|
return self::where('spread_uid', 'IN', implode(',', $uidSubordinate))->count();
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 获取用户下级推广人
|
|
|
* @param int $uid 当前用户
|