123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace huoMpAd;
- use huolib\constant\GameConst;
- use huolib\constant\MpConfConst;
- use huomp\model\weixin\MpConfAgentModel;
- use huomp\model\weixin\MpConfModel;
- class MpAd {
-
- public function attachAgentGameData($list) {
- $_mp_conf_model = new MpConfModel();
- $_mp_conf_agent_model = new MpConfAgentModel();
- foreach ($list as $_key => $_value) {
- if ($_value['classify'] == GameConst::GAME_MP) {
-
- $_mp_conf_info = $_mp_conf_model->getDataByAppId($_value['app_id'], MpConfConst::MP_CONF_TYPE_6);
- if (!empty($_mp_conf_info['id'])) {
- $_mp_conf_agent_info = $_mp_conf_agent_model->getInfoByConfAgent(
- $_mp_conf_info['id'], $_value['agent_id']
- );
- if (isset($_mp_conf_agent_info['advertiser_conf_id'])) {
- $_value['advertiser'] = $_mp_conf_model->getDataById(
- $_mp_conf_agent_info['advertiser_conf_id']
- );
- $list[$_key] = $_value;
- }
- }
- }
- }
- return $list;
- }
- }
|