1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- 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;
- }
- }
|