sylive_10114
This commit is contained in:
@@ -92,6 +92,71 @@ class Login extends BaseController
|
||||
$this->return_response($data, '登录成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取手机验证码
|
||||
* Created on: 2022/10/13 16:54
|
||||
* Created by: dengbw
|
||||
*/
|
||||
public function code_get()
|
||||
{
|
||||
$phone = $this->input_param('phone');
|
||||
if (!$phone) {
|
||||
$this->return_json('请输入绑定手机号');
|
||||
}
|
||||
$re = $this->mdSysAdmin->get(["phone" => $phone, 'status' => 0]);
|
||||
if (!$re) {
|
||||
$this->return_json('绑定手机号不存在');
|
||||
return;
|
||||
}
|
||||
$code = rand(100000, 999999);
|
||||
$redis = &load_cache('redis');
|
||||
$redis->save($phone, $code, 10 * 60);
|
||||
//send_sms($phone, $code);
|
||||
$this->return_response(['code'=>$code], '短信验证码发送成功, 请注意查收!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:忘记密码
|
||||
* Created on: 2022/10/13 15:34
|
||||
* Created by: dengbw
|
||||
*/
|
||||
public function forget_post()
|
||||
{
|
||||
$phone = $this->input_param('phone');
|
||||
$password = $this->input_param('password');
|
||||
$password2 = $this->input_param('password2');
|
||||
$code = $this->input_param('code');
|
||||
if (!$phone) {
|
||||
$this->return_json('请输入绑定手机号');
|
||||
}
|
||||
if (!$password) {
|
||||
$this->return_json('请输入新的登录密码');
|
||||
}
|
||||
if (!$password2) {
|
||||
$this->return_json('请再次输入登录密码');
|
||||
}
|
||||
if (mb_strlen($password) < 4) {
|
||||
$this->return_json('请输入至少4个字符的新密码');
|
||||
}
|
||||
if ($password != $password2) {
|
||||
$this->return_json('两次输入密码不一致');
|
||||
}
|
||||
if (!$code) {
|
||||
$this->return_json('请输入验证码');
|
||||
}
|
||||
$redis = &load_cache('redis');
|
||||
if (!$redis->get($phone)) {
|
||||
$this->return_json('验证码已过期');
|
||||
}
|
||||
if ($redis->get($phone) != $code) {
|
||||
$this->return_json('验证码错误');
|
||||
}
|
||||
$upDate['password'] = password_hash($password, PASSWORD_BCRYPT);
|
||||
$this->mdSysAdmin->update($upDate, ['phone' => $phone, 'status' => 0]);
|
||||
$redis->delete($phone);//删除验证码
|
||||
$this->return_response([], '密码修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:
|
||||
* Created on: 2022/8/29 17:06
|
||||
|
||||
@@ -485,23 +485,25 @@ class Activity extends BaseController
|
||||
$subscribe = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'subscribe']);
|
||||
$watch = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'watch']);
|
||||
$order = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'order']);
|
||||
$duration = $livePV = $watchDuration = 0;
|
||||
$duration = $livePV = $watchDuration = $watchDuration = $pvDuration = 0;
|
||||
if ($channelId) {
|
||||
$re_duration = $this->mdPolyvSession->sum('duration', ['channelId' => $channelId]);
|
||||
$re_livePV = $this->mdPolyvSession->sum('livePV', ['channelId' => $channelId]);
|
||||
if ($re_duration['duration']) {
|
||||
$re_liveUV = $this->mdPolyvSession->sum('liveUV', ['channelId' => $channelId]);
|
||||
$re_livePV = $this->mdPolyvSession->sum('livePV', ['channelId' => $channelId]);
|
||||
$duration = ceil($re_duration['duration'] / 60);
|
||||
$livePV = $re_livePV['livePV'];
|
||||
$watchDuration = round($duration / $livePV);
|
||||
$pvDuration = round($livePV / $re_liveUV['liveUV'],1);
|
||||
}
|
||||
}
|
||||
$activityData1 = [['name' => '参与区域数', 'value' => count($areaData)], ['name' => '参与门店数', 'value' => count($bizData)]
|
||||
, ['name' => '参与顾问数', 'value' => count($res_user)]];
|
||||
$url = "/sylive/activity/statistics/piechart?activityId={$activityId}&";
|
||||
$activityData2 = [['name' => '浏览人数', 'value' => $browse, 'url' => ''], ['name' => '预约人数', 'value' => $subscribe, 'url' => '']
|
||||
, ['name' => '观看人数', 'value' => $watch, 'url' => ''], ['name' => '订单数', 'value' => $order, 'url' => '']
|
||||
, ['name' => '直播时长', 'value' => $duration, 'url' => ''], ['name' => '观看次数', 'value' => $livePV, 'url' => '']
|
||||
, ['name' => '人均观看', 'value' => $watchDuration, 'url' => '']];
|
||||
$activityData2 = [['name' => '浏览数(人)', 'value' => $browse, 'url' => ''], ['name' => '预约数(人)', 'value' => $subscribe, 'url' => '']
|
||||
, ['name' => '观看数(人)', 'value' => $watch, 'url' => ''], ['name' => '订单数(单)', 'value' => $order, 'url' => '']
|
||||
, ['name' => '直播时长(分)', 'value' => $duration, 'url' => ''], ['name' => '观看数(人次)', 'value' => $livePV, 'url' => '']
|
||||
, ['name' => '人均观看(分)', 'value' => $watchDuration, 'url' => ''], ['name' => '人均观看(次)', 'value' => $pvDuration, 'url' => '']];
|
||||
// $activityData2 = [['name' => '浏览人数', 'value' => $browse, 'url' => "{$url}type=browse"], ['name' => '预约人数', 'value' => $subscribe, 'url' => "{$url}type=subscribe"]
|
||||
// , ['name' => '观看人数', 'value' => $watch, 'url' => "{$url}type=watch"], ['name' => '订单数', 'value' => $order, 'url' => "{$url}type=order"]
|
||||
// , ['name' => '直播时长', 'value' => $duration, 'url' => ''], ['name' => '观看次数', 'value' => $livePV, 'url' => ''], ['name' => '人均观看', 'value' => $watchDuration, 'url' => '']];
|
||||
|
||||
@@ -15,7 +15,7 @@ class ApiAuthHook
|
||||
// 保护路由为 /api/* 或者 /Api/*
|
||||
$this->route = '/^api/i';
|
||||
$this->auth = ',api/auth';
|
||||
$this->route_un = ['api/captcha', 'api/login', 'api/upload'];
|
||||
$this->route_un = ['api/captcha', 'api/login', 'api/login/code', 'api/login/forget', 'api/upload'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,8 +25,9 @@ class ApiAuthHook
|
||||
{
|
||||
$this->CI->load->helper('url');
|
||||
// $route 正则匹配是否符合 /api/* 或者 /Api/*
|
||||
if (preg_match($this->route, uri_string())) {
|
||||
if (!in_array(uri_string(), $this->route_un)) {
|
||||
$uri_string = uri_string();
|
||||
if (preg_match($this->route, $uri_string)) {
|
||||
if (!in_array($uri_string, $this->route_un)) {
|
||||
// 获取整个 request headers
|
||||
$headers = $this->CI->input->request_headers();
|
||||
// headers 中是否存在 Authorization
|
||||
|
||||
Reference in New Issue
Block a user