123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
-
- namespace app\admin\model;
-
- use think\Db;
- use think\Model;
-
-
- class AdPosition extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
- }
-
-
-
- public function getInfo($id, $field = '*')
- {
- $result = Db::name('AdPosition')->field($field)->find($id);
-
- return $result;
- }
-
-
-
- public function getListByIds($ids, $field = '*')
- {
- $map = array(
- 'id' => array('IN', $ids),
- 'lang' => get_admin_lang(),
- );
- $result = Db::name('AdPosition')->field($field)
- ->where($map)
- ->select();
-
- return $result;
- }
-
-
-
- public function getAll($field = '*', $index_key = '')
- {
- $result = Db::name('AdPosition')->field($field)
- ->where([
- 'lang' => get_admin_lang(),
- ])->select();
-
- if (!empty($index_key)) {
- $result = convert_arr_key($result, $index_key);
- }
-
- return $result;
- }
- }
|