Commit 5026da06 authored by ZhuChunYang's avatar ZhuChunYang

update

parent df994156
......@@ -52,6 +52,28 @@ class ApplicationController extends BaseController
}else{
return ['code' => 1,'data' => [],'msg' => 'id不能为空'];
}
}
/**
* @return array
* 添加应用用户数量
*/
public function actionAddUserNum()
{
$request = Yii::$app->request;
$id = $request->post('id',0);
if($id){
$key = "app_id_".$id;
$isExist = Yii::$app->redis_app->hexists('application_user_num',$key);
if($isExist){
Yii::$app->redis_app->hincrby('application_user_num',$key,1);
}else{
$app_user_num = rand(1000,2000);
Yii::$app->redis_app->hset('application_user_num',$key,$app_user_num);
}
return ['code' => 0,'data' => [], 'msg' => '应用用户数量更新成功'];
}else{
return ['code' => 1,'data' => [],'msg' => 'id不能为空'];
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment