CustomtaskContentModel.class.php
1.1 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
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 17/5/18
* Time: 11:34
*/
namespace Common\Model;
class CustomtaskContentModel extends AbstractModel
{
// 构造方法
public function __construct()
{
parent::__construct();
}
/**
* 根据应用获取应用数据ID数组
* @author zhonglei
* @param string $app 应用
* @return array
*/
public function getAppDataIds($app)
{
if (empty($app)) {
return [];
}
$wheres = [];
$params = [];
$this->_parse_where($wheres, $params, ['app' => strtolower($app)]);
// 企业标记
$wheres[] = "`{$this->prefield}domain`=?";
$params[] = QY_DOMAIN;
// 状态条件
$wheres[] = "`{$this->prefield}status`<?";
$params[] = $this->get_st_delete();
$wheres_sql = implode(' AND ', $wheres);
$sql = "SELECT DISTINCT `app_data_id` FROM __TABLE__ WHERE {$wheres_sql}";
$list = $this->_m->fetch_array($sql, $params);
return empty($list) ? [] : array_column($list, 'app_data_id');
}
}