model->where($where)->orderByRaw($order)->limit($limit)->get(); } else { return $this->model->where($where)->orderByRaw($order)->get(); } //return $this->model->where($where)->orderByRaw($order)->get(); } /** * 搜索次数增加1,如果不存在则增加一条数据 */ public function setInc($word, $type) { $word = trim($word); $word = substr($word, 0, 120); $word_info = $this->model->where(array('w_word'=>$word,'type'=>$type))->first(); $stime = date('Y-m-d H:i:s', time()); if ($word_info) { $this->model->where(array('id'=>$word_info->id))->increment('w_hot', 1); } else { $data = array( 'w_word' => $word, 'w_hot' => 1, 'type' => $type, 'created_at' => $stime, 'updated_at' => $stime ); $this->model->create($data); } return true; } }