-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcms_article_attitude.model.php
89 lines (80 loc) · 1.62 KB
/
cms_article_attitude.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* CMS评论模型
*
*
*
*
* by 33hao 好商城V3 www.33hao.com 开发
*/
defined('InShopNC') or exit('Access Invalid!');
class cms_article_attitudeModel extends Model{
public function __construct(){
parent::__construct('cms_article_attitude');
}
/**
* 读取列表
* @param array $condition
*
*/
public function getList($condition,$page='',$order='',$field='*'){
$result = $this->field($field)->where($condition)->page($page)->order($order)->select();
return $result;
}
/**
* 读取单条记录
* @param array $condition
*
*/
public function getOne($condition){
$result = $this->where($condition)->find();
return $result;
}
/*
* 判断是否存在
* @param array $condition
*
*/
public function isExist($condition) {
$result = $this->getOne($condition);
if(empty($result)) {
return FALSE;
}
else {
return TRUE;
}
}
/*
* 增加
* @param array $param
* @return bool
*/
public function save($param){
return $this->insert($param);
}
/*
* 增加
* @param array $param
* @return bool
*/
public function saveAll($param){
return $this->insertAll($param);
}
/*
* 更新
* @param array $update
* @param array $condition
* @return bool
*/
public function modify($update, $condition){
return $this->where($condition)->update($update);
}
/*
* 删除
* @param array $condition
* @return bool
*/
public function drop($condition){
return $this->where($condition)->delete();
}
}