* @version : HUOSDK 8.0 */ namespace huo\logic\game; use huo\model\common\CommonModel; use huo\model\game\GamePriceModel; use think\db\exception\DataNotFoundException; use think\db\exception\ModelNotFoundException; use think\exception\DbException; class GamePriceLogic extends CommonModel { /** * 获取计费点列表 * * @param array $where * @param string $page * @param string $order * * @return array */ public function getList($where = [], $page = '1,10', $order = '-update_time') { $_map = []; $_rdata = ['count' => 0, 'list' => []]; if (!empty($where['app_id'])) { $_map['app_id'] = $where['app_id']; } if (!empty($where['product_code'])) { $_map['product_code'] = $where['product_code']; } $_gp_model = New GamePriceModel(); $_count = $_gp_model->where($_map)->count('id'); if (empty($_count)) { return $_rdata; } $_order = $this->orderFilter($order); try { $_list = $_gp_model->where($_map)->page($page)->order($_order)->select(); if (is_object($_list)) { $_list = $_list->toArray(); } $_rdata['count'] = $_count; $_rdata['list'] = $_list; return $_rdata; } catch (DataNotFoundException $e) { return $_rdata; } catch (ModelNotFoundException $e) { return $_rdata; } catch (DbException $e) { return $_rdata; } } /** * 查找记录 * * @param array $map * * @return mixed */ public function getId($map = []) { return (new GamePriceModel())->where($map)->value('id'); } }