123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace huo\logic\game;
- use huo\model\common\CommonModel;
- use huo\model\game\ChannelModel;
- class ChannelLogic extends CommonModel {
-
- public function getChannelList($map = [], $order = 'id desc', $offset = 10) {
- $field = 'id, channel_name, company_name, link_man, mobile, position, create_time, update_time';
- $_items = (new ChannelModel())->field($field)->where($map)->order($order)->paginate($offset);
- return $_items;
- }
-
- public static function getNamesById() {
- $_arr = (new ChannelModel())->where('is_delete', 2)->order('id desc')->column('channel_name name', 'id');
- return $_arr;
- }
-
- public function addChannel($param, $return_id = false) {
- $_model = (new ChannelModel());
- $_rs = $_model->allowField(true)->save($param);
- if (true == $return_id) {
- return $_model->id;
- }
- return $_rs;
- }
-
- public function getChannelById($id) {
- $_rs = (new ChannelModel())->where('id', $id)->find();
- return $_rs;
- }
- public function updateChannel($id, $param) {
- $_rs = (new ChannelModel())->allowField(true)->save($param, ['id' => $id]);
- return $_rs;
- }
- }
|