123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * 咨询管理
- *
- *
- *
- *
-
- */
- 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'] = time();
- return $this->where($condition)->update($update);
- }
- }
|