TrainRightUsersModel.class.php
1.13 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
<?php
/**
* Created by PhpStorm.
* User: yingcai
* Date: 2017/10/10
* Time: 下午4:00
*/
namespace Common\Model;
class TrainRightUsersModel extends \Com\Model
{
// 构造方法
public function __construct()
{
parent::__construct('RightUsers', 'oa_education_');
}
public function list_right_users_conds($conds = array(), $fields = '*')
{
$params = array();
// 条件
$wheres = array();
if (!$this->_parse_where($wheres, $params, $conds)) {
return false;
}
// 企业标记
$wheres[] = "a.domain=?";
$params[] = QY_DOMAIN;
// 状态条件
$wheres[] = "a.status<?";
$params[] = $this->get_st_delete();
// 企业标记
$wheres[] = "b.domain=?";
$params[] = QY_DOMAIN;
// 状态条件
$wheres[] = "b.status<?";
$params[] = $this->get_st_delete();
// 读取记录
return $this->_m->fetch_array("SELECT {$fields} FROM __TABLE__ a LEFT JOIN oa_education_education b ON a.ed_id=b.ed_id WHERE " . implode(' AND ',
$wheres), $params);
}
}