12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
-
-
- namespace app\common\model;
-
- use think\Db;
- use think\Model;
-
-
- class Channelfield extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
- }
-
-
-
- public function getInfo($id, $field = '*')
- {
- $result = Db::name('Channelfield')->field($field)->find($id);
-
- return $result;
- }
-
-
-
- public function getInfoByWhere($where, $field = '*')
- {
- $result = Db::name('Channelfield')->field($field)->where($where)->find();
-
- return $result;
- }
-
-
-
- public function getListByWhere($map = array(), $field = '*', $index_key = '')
- {
- $result = Db::name('Channelfield')->field($field)
- ->where($map)
- ->order('sort_order asc, channel_id desc, id desc')
- ->select();
-
- if (!empty($index_key)) {
- $result = convert_arr_key($result, $index_key);
- }
-
- return $result;
- }
- }
|