Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
hujun
tl_estate
Commits
e8381006
Commit
e8381006
authored
Jun 13, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PC-评价列表
parent
217676a8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
1 deletion
+161
-1
.DS_Store
.DS_Store
+0
-0
Evaluation.php
application/index/controller/Evaluation.php
+85
-0
VerifyValidate.php
application/index/validate/VerifyValidate.php
+31
-0
evaluation_list.html
application/index/view/evaluation/evaluation_list.html
+11
-0
Evaluate.php
application/model/Evaluate.php
+30
-0
route.php
application/route.php
+3
-0
index.php
public/index.php
+1
-1
No files found.
.DS_Store
0 → 100644
View file @
e8381006
File added
application/index/controller/Evaluation.php
0 → 100644
View file @
e8381006
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/6/13
* Time: 上午10:18
*/
use
app\index\extend\Basic
;
use
app\model\Evaluate
;
use
think\Request
;
class
Evaluation
extends
Basic
{
protected
$evaluateModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
evaluateModel
=
new
Evaluate
();
}
/**
* 评价列表
* User: 朱伟
* Date: 2018/6/13
* Time: 上午10:34
*/
public
function
evaluationList
(){
if
(
$this
->
request
->
isAjax
())
{
return
view
(
'evaluation/evaluation_list'
);
}
$result
=
''
;
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"VerifyValidate.select"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//搜索条件 start
//1.评价时间
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
}
//2.部门
if
(
!
empty
(
$params
[
'district_id'
]))
{
$where
[
'a.district_id'
]
=
$params
[
'district_id'
];
}
//3.门店名称
if
(
!
empty
(
$params
[
'store_id'
]))
{
$where
[
'c.store_id'
]
=
$params
[
'store_id'
];
}
//4.姓名
if
(
!
empty
(
$params
[
'user_name'
]))
{
$where
[
'b.user_name'
]
=
[
'EXP'
,
'b.user_name LIKE "%'
.
$this
->
params
[
'phone'
]
.
'%" '
];
}
//5.手机号
if
(
!
empty
(
$params
[
'user_phone'
]))
{
$where
[
'b.user_phone'
]
=
[
'EXP'
,
'b.user_phone LIKE "%'
.
$this
->
params
[
'phone'
]
.
'%" '
];
}
//6.进场时间
//if (!empty($params['registration_start']) && !empty($params['registration_end'])) {
//$where['a.registration_time'] = ['between time', [$params['registration_start']. ' 00:00:00', $params['registration_end'] . ' 23:59:59']];
//}
//搜索条件 end
$fields_evaluate
=
'user_nick,user_phone,evaluate_grade,evaluate_content,a.create_time,c.name,c.phone'
;
$data
[
'list'
]
=
$this
->
evaluateModel
->
findEvaluationList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
$where
);
$data
[
'total'
]
=
$this
->
evaluateModel
->
findEvaluationListCount
(
$fields_evaluate
,
$where
);
//var_dump($result);
//return $result;
$data
[
'average_score'
]
=
0
;
//进场平均分数
$data
[
'average_score_evaluation'
]
=
0
;
//评价平均分数
return
$this
->
response
(
200
,
'success'
,
$data
);
}
}
\ No newline at end of file
application/index/validate/VerifyValidate.php
0 → 100644
View file @
e8381006
<?php
namespace
app\index\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/6/13
* Time: 上午11:02
*/
class
VerifyValidate
extends
Validate
{
protected
$rule
=
[
'id'
=>
'require|number'
,
// 'wx_open_id' => 'require|length:10,50',
// 'source' => 'require|number',
// 'user_id' => 'require|number|gt:0',
];
protected
$message
=
[
'id.require'
=>
'id不能为空'
,
];
protected
$scene
=
[
'select'
=>
[
'id'
],
];
}
\ No newline at end of file
application/index/view/evaluation/evaluation_list.html
0 → 100644
View file @
e8381006
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
application/model/Evaluate.php
View file @
e8381006
...
@@ -99,4 +99,34 @@ class Evaluate extends Model
...
@@ -99,4 +99,34 @@ class Evaluate extends Model
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
}
}
public
function
findEvaluationList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
=
''
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'a_agents c'
,
'a.agents_id = c.id'
,
'left'
)
->
where
(
'is_show'
,
0
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
return
$result
;
}
public
function
findEvaluationListCount
(
$field
,
$params
=
''
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'a_agents c'
,
'a.agents_id = c.id'
,
'left'
)
->
where
(
'is_show'
,
0
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
}
application/route.php
View file @
e8381006
...
@@ -245,6 +245,9 @@ Route::group('index', [
...
@@ -245,6 +245,9 @@ Route::group('index', [
'test'
=>
[
'index/WxTest/test'
,
[
'method'
=>
'POST|GET'
]
],
//wx
'test'
=>
[
'index/WxTest/test'
,
[
'method'
=>
'POST|GET'
]
],
//wx
//评价列表
'evaluationList'
=>
[
'index/Evaluation/evaluationList'
,
[
'method'
=>
'POST|GET'
]
],
//评价列表 朱伟 2018-06-13
]);
]);
...
...
public/index.php
View file @
e8381006
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
// [ 应用入口文件 ]
// 定义应用目录
// 定义应用目录
define
(
'APP_PATH'
,
__DIR__
.
'/../application/'
);
define
(
'APP_PATH'
,
__DIR__
.
'/../application/'
);
// 加载框架基础引导文件
// 加载框架基础引导文件
require
__DIR__
.
'/../thinkphp/base.php'
;
require
__DIR__
.
'/../thinkphp/base.php'
;
// 添加额外的代码
// 添加额外的代码
// ...
// ...
// 执行应用
// 执行应用
...
...
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