發(fā)布時(shí)間:2020-04-26
欄目:其他
* 搶購商品前處理當(dāng)前會(huì)員是否進(jìn)入隊(duì)列
* @access public
* @author bieanju
*/
publicfunctiongoods_number_queue(){
!$this->user_id && $this->ajaxReturn(array("status"=> "-1","msg"=> "請(qǐng)先登錄"));
$model= M("flash_sale");
$where['goods_id'] = $this->goods_id;
$goods_info= $model->where($where)->find();
!$goods_info&& $this->error("對(duì)不起當(dāng)前商品不存在或已下架重要的角色!");
/* redis 隊(duì)列 */
$redis= $this->connectRedis();
/* 進(jìn)入隊(duì)列 */
$goods_number_key= $redis->llen("{$this->goods_number_key}");
if(!$redis->hGet("{$this->user_queue_key}", $this->user_id)) {
$goods_number_key= $redis->lpop("{$this->goods_number_key}");
PHPweb批量更新文章}
if($goods_number_key){
// 判斷用戶是否已在隊(duì)列
if(!$redis->hGet("{$this->user_queue_key}"PHPweb批量刪除關(guān)鍵詞 , $this->user_id)) {
// 插入搶購用戶信息
PHPweb批量助手$userinfo= array(
"user_id"=> $this->user_id,
"create_time"=> time()
);
$redis->hSet("{$this->user_queue_key}", $this->user_id, serialize($userinfo));
$this->ajaxReturn(array("status"=> "1"));
}else{
$modelCart= M("cart");
$condition['user_id'] = $this->user_id;
$condition['goods_id'] = $this->goods_id;
$condition['prom_type'] = 1;
$cartlist= $modelCart->where($condition)->count();
if($cartlist> 0){
PHPweb批量添加欄目$this->ajaxReturn(array("status"=> "2"));
PHPweb批量上傳內(nèi)容}else{
$this->ajaxReturn(array("status"=> "1"));
}
}
}else{
$this->ajaxReturn(array("status"=> "-1","msg"=> "系統(tǒng)繁忙,請(qǐng)重試數據顯示!"));
}
}
文章地址:http://61py.com/article/other/qgspqcldqhysfjrdl.html

- 1通王CMS 2.0簡介
- 2黑帽網(wǎng)站排名檢測(cè)
- 3MySQL中經(jīng)典的too many connection怎么破
- 4網(wǎng)易郵箱洪陸駕:反垃圾郵件需集合全球力量
- 5站群友鏈換鏈神器
- 6云勢(shì)軟件VirgoEDC助力安徽萬邦記得牢、迪時(shí)咨詢等公司臨床試驗(yàn)數(shù)據(jù)采集智能化
- 7Authorize 屬性通過聲明的方式保護(hù)控制器或其部分方法
- 8域名是稀有資源,好的域名重要的作用,在一定時(shí)期內(nèi)會(huì)越來越升值
- 9解析常見的PHP緩存技術(shù)有哪些
- 10對(duì)ASP.NET程序員非常有用工具