-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconsult.model.php
69 lines (64 loc) · 1.57 KB
/
consult.model.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* 咨询管理
*
*
*
*
* by 33hao 好商城V3 www.33hao.com 开发
*/
defined('InShopNC') or exit('Access Invalid!');
class consultModel extends Model{
public function __construct() {
parent::__construct('consult');
}
/**
* 咨询数量
*
* @param array $condition
* @return int
*/
public function getConsultCount($condition) {
return $this->where($condition)->count();
}
/**
* 添加咨询
* @param array $insert
* @return int
*/
public function addConsult($insert){
return $this->insert($insert);
}
/**
* 商品咨询列表
* @param unknown $condition
* @param string $field
* @param number $limit
* @param number $page
* @param string $order
* @return array
*/
public function getConsultList($condition, $field = '*', $limit = 0, $page = 0, $order = 'consult_id desc') {
return $this->where($condition)->field($field)->order($order)->limit($limit)->page($page)->select();
}
public function getConsultInfo($condition) {
return $this->where($condition)->find();
}
/**
* 删除咨询
*
* @param unknown_type $id
*/
public function delConsult($condition){
return $this->where($condition)->delete();
}
/**
* 回复咨询
*
* @param unknown_type $input
*/
public function editConsult($condition, $update){
$update['consult_reply_time'] = TIMESTAMP;
return $this->where($condition)->update($update);
}
}