CommentScoreModel.class.php
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* 培训评价评分表
* @author: houyingcai
* @email: 594609175@qq.com
* @date : 2017-08-29 16:07:27
* @version $Id$
*/
namespace Common\Model;
class CommentScoreModel extends AbstractModel
{
public function __construct()
{
parent::__construct();
}
/**
* 培训评价统计评分计算
*
* @author: 蔡建华
* @param $conds array 查询条件
* @param string $fields 查询的字段
* @param string $group 分组字段
* @return array|bool
*/
public function list_group_score($conds = [], $fields = '*', $group = '')
{
$params = [];
// 条件
$wheres = [];
if (!$this->_parse_where($wheres, $params, $conds)) {
return false;
}
// 企业标记
$wheres[] = "`{$this->prefield}domain`=?";
$params[] = QY_DOMAIN;
// 状态条件
$wheres[] = "`{$this->prefield}status`<?";
$params[] = $this->get_st_delete();
if ($group) {
$group = "group by {$group}";
}
$sql = "select {$fields} from __TABLE__ WHERE " . implode(" AND ", $wheres) . " {$group} ";
return $this->_m->fetch_array($sql, $params);
}
}