RecordModel.class.php
841 Bytes
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
<?php
/**
* RecordModel.class.php
* $author$
*/
namespace Common\Model;
class RecordModel extends AbstractModel
{
/**
* 构造方法
*/
public function __construct()
{
parent::__construct();
}
/**
* 根据问题ID获取该问题已回答的记录
*
* @param int $q_id 问题ID
*
* @return array
*/
public function list_by_where($q_id = 0)
{
// 组装查询语句
$where = "status <? AND domain=? and q_id=? and (answer<>'' or other<>'') ";
// 操作状态和域名
$params = [
self::ST_DELETE,
QY_DOMAIN,
$q_id
];
$sql = "SELECT * FROM __TABLE__ WHERE " . $where;
return $this->_m->fetch_array($sql, $params);
}
}