123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- namespace huo\model\distribution;
- use huo\model\common\CommonModel;
- class PromotiondomainModel extends CommonModel {
- protected $name = 'promotion_domain';
-
- protected $autoWriteTimestamp = true;
- public function updateData($gmh_data, $_map = null) {
- $_data = $gmh_data;
- $_data['update_time'] = time();
- $_rs = self::update($_data, $_map, true);
- if (false == $_rs) {
- return false;
- } else {
- return true;
- }
- }
-
- public function getInfoById($id, $base = true) {
- $_map['id'] = $id;
- $_info = $this->useGlobalScope($base)->where($_map)->find();
- if (false === $_info) {
- return false;
- }
- if (is_object($_info)) {
- return $_info->toArray();
- } else {
- return $_info;
- }
- }
-
- public function addData($data) {
- if (empty($data)) {
- return false;
- }
- $_obj = self::create($data, true);
- if (false == $_obj) {
- return false;
- }
- return $_obj->id;
- }
-
- public function getIdValues($where, $_field = 'domain') {
- $_platforms = $this->where($where)
- ->column($_field, 'id');
- return $_platforms;
- }
- }
|