[html]
function zeng_integral(){
$jifen=& m('integral');
/*判断网吧*/
$store=isset($store_id)?intval($store_id):0;
$injifen=$jifen->get(array('user_id'=>$_SESSION['user_info']['user_id']));
$yanzhen=json_decode($injifen['integrallog'],true);
if(isset($injifen)){
$arrstore=array();
foreach ($yanzhen as $k=>$v){
$arrstore[]=$v['store_id'];
}
/*判断网吧积分是否存在如果存*/
if (in_array($store,$arrstore)) {
foreach ($yanzhen as $key=>$val){
$yanzhen[$key]['store_id']=$key;
$yanzhen[$key]['jifen']=$val['jifen']+5;
}
$integral=json_encode($yanzhen);
}else {
foreach ($yanzhen as $key=>$val){
$yanzhen[$store]['store_id']=$store;
$yanzhen[$store]['jifen']=1;
}
$integral=json_encode($yanzhen);
}
/*构造数据*/
$data=array(
'integrallog'=>$integral,
);
$integ=$jifen->edit($injifen['id'],$data);
if ($integ) {
return true;
}
}else {
/*构造数组*/
$config=array();
$config[$store]['store_id']=$store;
$config[$store]['jifen']=1;
$integral=json_encode($config);
/*构造数据*/
$data=array(
'user_id'=>$_SESSION['user_info']['user_id'],
'integrallog'=>$integral,
);
$integ=$jifen->add($data);
if ($integ) {
return true;
}
}
}
function zeng_integral(){
$jifen=& m('integral');
/*判断网吧*/
$store=isset($store_id)?intval($store_id):0;
$injifen=$jifen->get(array('user_id'=>$_SESSION['user_info']['user_id']));
$yanzhen=json_decode($injifen['integrallog'],true);
if(isset($injifen)){
$arrstore=array();
foreach ($yanzhen as $k=>$v){
$arrstore[]=$v['store_id'];
}
/*判断网吧积分是否存在如果存*/
if (in_array($store,$arrstore)) {
foreach ($yanzhen as $key=>$val){
$yanzhen[$key]['store_id']=$key;
$yanzhen[$key]['jifen']=$val['jifen']+5;
}
$integral=json_encode($yanzhen);
}else {
foreach ($yanzhen as $key=>$val){
$yanzhen[$store]['store_id']=$store;
$yanzhen[$store]['jifen']=1;
}
$integral=json_encode($yanzhen);
}
/*构造数据*/
$data=array(
'integrallog'=>$integral,
);
$integ=$jifen->edit($injifen['id'],$data);
if ($integ) {
return true;
} www.2cto.com
}else {
/*构造数组*/
$config=array();
$config[$store]['store_id']=$store;
$config[$store]['jifen']=1;
$integral=json_encode($config);
/*构造数据*/
$data=array(
'user_id'=>$_SESSION['user_info']['user_id'],
'integrallog'=>$integral,
);
$integ=$jifen->add($data);
if ($integ) {
return true;
}
}
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
C++高性能并发应用_C++如何开发性能关键应用
Java AI集成Deep Java Library_Java怎么集成AI模型部署
Golang后端API开发_Golang如何高效开发后端和API
Python异步并发改进_Python异步编程有哪些新改进
C++系统编程内存管理_C++系统编程怎么与Rust竞争内存安全
Java GraalVM原生镜像构建_Java怎么用GraalVM构建高效原生镜像
Python FastAPI异步API开发_Python怎么用FastAPI构建异步API
C++现代C++20/23/26特性_现代C++有哪些新标准特性如modules和coroutines
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号