| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\service\model;
- use think\Model;
- /**
- * 快捷语模型
- */
- class Words extends Model
- {
- /**
- * 数据筛选
- *
- * @access public
- * @param mixed $field 字段
- * @param mixed $where 条件
- * @return array 返回类型
- */
- public function selectWords($field, $where=[])
- {
- $result = $this->field($field);
- if (empty($where) === false) {
- $result = $result->where($where);
- }
- $result = $result->select();
- return $result;
- }//end selectWords()
- /**
- * 数据修改
- *
- * @access public
- * @param mixed $data 数据
- * @param mixed $where 条件
- * @return array 返回类型
- */
- public function updateWords($where, $data)
- {
- $result = $this->where($where)->update($data);
- return $result;
- }//end updateWords()
- }
|