* @version : HUOSDK 9.0 */ namespace huomp\model\weixin; class MpAdSourceModel extends CommonModel { protected $table = 'mp_ad_source'; protected $pk = 'id'; /* 开启自动写入时间戳字段 */ protected $cache_key_prefix = ''; protected $type = [ 'id' => 'integer', 'conf_id' => 'integer', 'type' => 'string', 'name' => 'string', 'description' => 'string', 'advertiser_conf_id' => 'integer', 'source_id' => 'string', 'create_time' => 'integer', 'update_time' => 'integer', ]; public function getInfoByConfType($conf_id, $agent_id, $advertiser_conf_id, $type = 'WECHAT_MINI_PROGRAM') { $_map = [ 'conf_id' => $conf_id, 'agent_id' => $agent_id, 'type' => $type, 'advertiser_conf_id' => $advertiser_conf_id ]; $_data = $this->where($_map) ->find(); if (is_object($_data)) { $_data = $_data->toArray(); } return $_data; } }