CompositeScoreModel.class.php
1.05 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
<?php
/**
* 培训综合评分表
* @author: houyingcai
* @email: 594609175@qq.com
* @date : 2017-08-29 16:09:34
* @version $Id$
*/
namespace Common\Model;
class CompositeScoreModel extends AbstractModel
{
public function __construct()
{
parent::__construct();
}
/**
* 获取总分
*
* @author: 蔡建华
* @param $conds array 查询条件
* @param string $fields 查询的字段
* @return array|bool
*/
public function get_score($conds = [], $fields = '*')
{
$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();
$sql = "select {$fields} from __TABLE__ WHERE " . implode(" AND ", $wheres);
return $this->_m->result($sql, $params);
}
}