fix(user): 兼容分销商合伙股东字段缺失异常并补充数据库升级脚本
这个提交包含在:
@@ -72,12 +72,19 @@ class User extends Common
|
||||
}
|
||||
}
|
||||
|
||||
$hasPartnerCol = false;
|
||||
try {
|
||||
$hasPartnerCol = in_array('is_partner', Db::name('shopro_commission_agent')->getTableFields());
|
||||
} catch (\Exception $e) {
|
||||
$hasPartnerCol = false;
|
||||
}
|
||||
|
||||
$stats = [
|
||||
'total_users' => UserModel::count(),
|
||||
'maker_count' => Db::name('shopro_commission_agent')->where('level', '>=', 2)->count(),
|
||||
'venue_count' => Db::name('shopro_commission_agent')->where('is_venue', 1)->count(),
|
||||
'county_count' => Db::name('shopro_commission_agent')->where('is_county', 1)->count(),
|
||||
'partner_count' => Db::name('shopro_commission_agent')->where('is_partner', 1)->count(),
|
||||
'partner_count' => $hasPartnerCol ? Db::name('shopro_commission_agent')->where('is_partner', 1)->count() : 0,
|
||||
'active_count' => Db::name('shopro_commission_agent')->where('last_self_order_time', '>=', $now - $days * 86400)->count(),
|
||||
];
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户