You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
21
hyhproject/app/common/function.php
Executable file
21
hyhproject/app/common/function.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use think\Db;
|
||||
/**
|
||||
* ============================================================================
|
||||
*/
|
||||
/**
|
||||
* 获取购物车数量
|
||||
*/
|
||||
function WSTCartNum(){
|
||||
$userId = session('WST_USER.userId');
|
||||
$cartNum = Db::name('carts')->where(['userId'=>$userId])->field('cartId')->select();
|
||||
$count = count($cartNum);
|
||||
return $count;
|
||||
}
|
||||
function appLogOut(){
|
||||
Db::name('users')->where(['userId'=>1])->setField('token','');
|
||||
session('WST_USER',null);
|
||||
//setcookie("loginPwd", null);
|
||||
session('WST_MO_WlADDRESS',null);
|
||||
}
|
||||
|
Reference in New Issue
Block a user