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