Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac-quanmin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HTML5-李恒逸
sunac-quanmin
Commits
315e6649
Commit
315e6649
authored
Jun 15, 2017
by
html5-李恒逸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
19c90a28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
41 deletions
+40
-41
building_rsync_begin_time
html/application/cache/building_rsync_begin_time
+2
-2
index.php
html/application/controllers/admin/index.php
+37
-38
index.php
html/application/views/admin/index.php
+1
-1
No files found.
html/application/cache/building_rsync_begin_time
View file @
315e6649
a:3:{s:4:"time";i:1493257676;s:3:"ttl";i:2592000;s:4:"data";i:1493257676;}
\ No newline at end of file
a:3:{s:4:"time";i:1497345334;s:3:"ttl";i:86400;s:4:"data";i:1497345332;}
\ No newline at end of file
html/application/controllers/admin/index.php
View file @
315e6649
...
...
@@ -8,7 +8,7 @@
*
*/
class
Index
extends
CI_Controller
{
const
WEBSITE_ADMIN
=
1
;
const
PAGE_SIZE
=
20
;
...
...
@@ -18,23 +18,23 @@ class Index extends CI_Controller{
public
function
__construct
()
{
parent
::
__construct
();
//加载配置文件
$this
->
config
->
load
(
'user_config'
,
true
);
//加载基础帮助函数
$this
->
load
->
helper
(
'util'
);
//生成菜单
$this
->
data
[
'menu'
]
=
newgenerate_menu
();
//加载后台日志类
$this
->
load
->
library
(
'loger'
);
//语言包
$this
->
lang
->
load
(
'op_log'
,
'chinese'
);
$this
->
lang
->
load
(
'error'
,
'chinese'
);
}
/**
*
*
* 网站首页
* @author wenhuijang
* @version 2014-09-25
...
...
@@ -42,7 +42,7 @@ class Index extends CI_Controller{
function
index
()
{
//校验是否为管理员
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
?
true
:
false
;
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
?
true
:
false
;
if
(
!
$this
->
session
->
userdata
(
'u_id'
)
||
!
$is_admin
)
{
alert_redirect
(
site_url
(
'admin/index/login'
));
...
...
@@ -51,12 +51,12 @@ class Index extends CI_Controller{
//获取总数
$this
->
load
->
model
(
'user_model'
,
'user'
);
$this
->
data
[
'user_count'
]
=
$this
->
user
->
get_count
(
array
(
'user_type'
=>
2
,
'user_role'
=>
0
,
'is_deleted'
=>
0
));
$this
->
load
->
model
(
'building_model'
,
'building'
);
$this
->
data
[
'building_count'
]
=
$this
->
building
->
get_building_count
(
array
(
'B.is_deleted'
=>
0
));
$this
->
load
->
model
(
'customer_building_model'
,
'customer_building'
);
$this
->
data
[
'sales_count'
]
=
$this
->
customer_building
->
get_count
(
array
(
'is_deleted'
=>
0
,
'recommend_status'
=>
6
));
$this
->
data
[
'sales_count'
]
=
$this
->
customer_building
->
get_count
(
array
(
'is_deleted'
=>
0
,
'recommend_status'
=>
4
));
$manager_id
=
$this
->
session
->
userdata
(
'u_id'
);
...
...
@@ -64,7 +64,7 @@ class Index extends CI_Controller{
//操作日志
$this
->
load
->
model
(
'op_log_model'
);
$logs
=
$this
->
op_log_model
->
get_page
(
array
(
'manager_id'
=>
$manager_id
),
'id desc'
,
1
,
self
::
PAGE_SIZE
+
2
);
$this
->
load
->
model
(
'building_distributor_model'
,
'building_distributor'
);
//销管与分销商的关联
//销管登录,有小红点
...
...
@@ -72,7 +72,7 @@ class Index extends CI_Controller{
$last_time
=
$last
[
'create_time'
];
$update_time
=
$last
[
'update_time'
]
?
:
'0'
;
if
(
$update_time
)
if
(
$update_time
)
{
$where
=
'M.id = '
.
$manager_id
.
' and CB.distributor_id > 0 and CB.create_time >='
.
$update_time
;
}
else
{
...
...
@@ -115,7 +115,7 @@ class Index extends CI_Controller{
}
/**
*
*
* 显示登录页面
* @author wenhuijang
* @version 2013-11-29
...
...
@@ -127,7 +127,7 @@ class Index extends CI_Controller{
{
$this
->
data
[
'err_info'
]
=
$this
->
lang
->
line
(
$err_code
);
}
$captcha_type
=
'small'
;
$captcha
=
generate_captcha
(
$captcha_type
);
//var_dump($captcha);die;
...
...
@@ -137,16 +137,16 @@ class Index extends CI_Controller{
//显示登录页面
$this
->
load
->
view
(
'admin/login'
,
$this
->
data
);
}
/**
*
*
* 后台登录
* @author wenhuijang
* @version 2013-10-25
*/
function
login
(
$err_code
=
null
)
{
//test data
/*
$user_info = array(
...
...
@@ -154,16 +154,16 @@ class Index extends CI_Controller{
'email' => 'wenhuijang@sina.com',
'user_name' => 'wenhuijang',
'type' => 1,
'user_type' => 1,
'user_type' => 1,
'role' => '1',
'privileges' => '1,2,3,4,5,6,7,8'
'privileges' => '1,2,3,4,5,6,7,8'
);
//将用户信息存入session
$this->session->set_userdata($user_info);
alert_redirect(site_url('admin/index'));return;
alert_redirect(site_url('admin/index'));return;
*/
//判断用户是否登录操作
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
>
0
?
true
:
false
;
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
>
0
?
true
:
false
;
if
(
$this
->
session
->
userdata
(
'u_id'
)
&&
$is_admin
)
{
alert_redirect
(
site_url
(
'admin/index'
));
...
...
@@ -180,7 +180,7 @@ class Index extends CI_Controller{
$this
->
data
[
'user_name'
]
=
$user_name
;
$password
=
$this
->
input
->
post
(
'password'
,
true
);
$captcha
=
$this
->
input
->
post
(
'captcha'
,
true
);
//用户名或者密码
if
(
empty
(
$user_name
)
||
empty
(
$password
))
{
...
...
@@ -210,16 +210,16 @@ class Index extends CI_Controller{
'email' => 'wenhuijang@sina.com',
'user_name' => 'wenhuijang',
'type' => 1,
'user_type' => 1,
'user_type' => 1,
'role' => '1',
'privileges' => '1,2,3,4,5,6,7,8'
'privileges' => '1,2,3,4,5,6,7,8'
);
//将用户信息存入session
$this->session->set_userdata($user_info);
//记录日志
$log = array(
'log' => sprintf($this->lang->line('op_login_fail'), $user_name)
);
);
$this->loger->add_op_log('login',$log);
return alert_redirect(site_url('admin/index/'), $this->lang->line('err_44164') . ',暂且虚拟账户登录');
*/
...
...
@@ -257,7 +257,7 @@ class Index extends CI_Controller{
$this
->
load
->
helper
(
'util'
);
$encrypt_name
=
authcode
(
$user_name
,
'ENCODE'
);
$encrypt_pwd
=
authcode
(
$password
,
'ENCODE'
);
//请求接口校验登录
$this
->
load
->
helper
(
'rpc'
);
$param
=
array
(
...
...
@@ -280,7 +280,7 @@ class Index extends CI_Controller{
return
;
}
}
$this
->
load
->
model
(
'role_model'
);
$role
=
$this
->
role_model
->
get_roles
(
array
(
'id'
=>
$cur_user
[
'role_id'
]));
$user_info
=
array
(
...
...
@@ -288,13 +288,13 @@ class Index extends CI_Controller{
'email'
=>
$user_name
,
'user_name'
=>
$cur_user
[
'manager_name'
],
'type'
=>
1
,
'user_type'
=>
1
,
'user_type'
=>
1
,
'role'
=>
$cur_user
[
'role_id'
],
'privileges'
=>
$role
[
0
][
'privileges'
]
'privileges'
=>
$role
[
0
][
'privileges'
]
);
//将用户信息存入session
$this
->
session
->
set_userdata
(
$user_info
);
//记录日志
$this
->
u_name
=
$cur_user
[
'manager_name'
];
$log
=
array
(
...
...
@@ -307,7 +307,7 @@ class Index extends CI_Controller{
}
/**
*
*
* 管理员退出系统
* @author wenhuijang
* @version 2013-10-25
...
...
@@ -318,7 +318,7 @@ class Index extends CI_Controller{
$this
->
u_name
=
$this
->
session
->
userdata
(
'user_name'
);
$log
=
array
(
'log'
=>
sprintf
(
$this
->
lang
->
line
(
'op_logout_succ'
),
$this
->
u_name
)
);
);
$this
->
loger
->
add_op_log
(
'logout'
,
$log
);
$this
->
session
->
sess_destroy
();
...
...
@@ -326,13 +326,13 @@ class Index extends CI_Controller{
}
/**
*
*
* 修改登录密码
* @author libin
* @version 2013-10-25
*/
function
changePwd
(){
$this
->
load
->
model
(
'manager_model'
,
'manager'
);
$this
->
u_name
=
$this
->
session
->
userdata
(
'user_name'
);
$this
->
data
[
'user_name'
]
=
$this
->
u_name
;
...
...
@@ -357,11 +357,11 @@ class Index extends CI_Controller{
alert_redirect
(
site_url
(
'admin/index/login'
),
'修改成功'
);
}
}
}
}
}
\ No newline at end of file
}
html/application/views/admin/index.php
View file @
315e6649
...
...
@@ -72,7 +72,7 @@
<?php
echo
$sales_count
;
?>
</div>
<div
class=
"desc"
>
已
完成销售
已
签约客户
</div>
</div>
<a
class=
"more"
href=
"
<?php
echo
site_url
(
'admin/salesadmin'
);
?>
"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment