You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
admin
app
common
home
home2
behavior
common
conf
controller
model
Articles.php
Attributes.php
Base.php
Goods.php
GoodsVirtuals.php
HomeMenus.php
Imports.php
Reports.php
Settlements.php
ShopConfigs.php
ShopFreights.php
ShopRoles.php
ShopUsers.php
Shops.php
SpecItems.php
Users.php
validate
view
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
34 lines
1.4 KiB
PHP
Executable File
34 lines
1.4 KiB
PHP
Executable File
<?php
|
|
namespace wstmart\home\model;
|
|
use wstmart\common\model\Users as CUsers;
|
|
/**
|
|
* ============================================================================
|
|
* 用户类
|
|
*/
|
|
use think\Db;
|
|
class Users extends CUsers{
|
|
/**
|
|
* 获取各订单状态数、未读消息数、账户安全等级
|
|
*/
|
|
function getStatusNum(){
|
|
$userId = (int)session('WST_USER.userId');
|
|
$data = [];
|
|
// 用户消息
|
|
$data['message'] = Db::name('messages')->where(['receiveUserId'=>$userId,'msgStatus'=>0,'dataFlag'=>1])->count();
|
|
//获取用户订单状态
|
|
$data['waitPay'] = Db::name('orders')->where(['userId'=>$userId,'orderStatus'=>-2,'dataFlag'=>1])->count();
|
|
$data['waitReceive'] = Db::name('orders')->where(['userId'=>$userId,'orderStatus'=>['in',[0,1]],'dataFlag'=>1])->count();
|
|
$data['received'] = Db::name('orders')->where(['userId'=>$userId,'orderStatus'=>2,'dataFlag'=>1])->count();
|
|
$data['waitAppr'] = Db::name('orders')->where(['userId'=>$userId,'orderStatus'=>2,'isAppraise'=>0,'dataFlag'=>1])->count();
|
|
// 账户安全等级
|
|
$level = 1;
|
|
$users = $this->field('userPhone,userEmail')->find($userId);
|
|
if(!empty($users['userPhone']))++$level;
|
|
if(!empty($users['userEmail']))++$level;
|
|
$data['level'] = $level;
|
|
//关注商品
|
|
$data['gfavorite'] = Db::name('favorites')->where(['userId'=>$userId,'favoriteType'=>0])->count();
|
|
return $data;
|
|
}
|
|
}
|