1、问题描述:

2、E:\html\pim\php_aspire-mcloud\module\pim\controller\Configure.class.php

    public function popupGetAction( $params )
{
$keys = array(
self::KEY_CLIENT_ID,
self::KEY_SESSION,
self::KEY_VERSION,
self::KEY_DEVICE_ID,
self::KEY_FROM
);
parent::checkBaseParam($params, $keys); $params->useEnv = '1'; //是否区分环境
$params->type = 'activity_popup_config'; //相对于pms yellowPage.php 里面popupConfig方法
$return = Service_Configure::getConfigureByType($params); $user = Util_User::getInstance();
$mobile = $user->getMobile(); $authHelper = new Auth_Helper();
$authHelper->{Auth_Helper::KEY_MOBILE} = $mobile;
$returns = $authHelper->operatorGet();
$provinceId = $returns['data']['provCode'];
$cityId = $returns['data']['regionCode'];
$operator = $returns['data']['operator']; //安卓版本限制
if (isset($return['android_version']) && $return['android_version']) {
if ($params->{self::KEY_CLIENT_ID} == '4') {
$allow_android_version_arr = explode(',', $return['android_version']);
if (!in_array($params->{self::KEY_VERSION}, $allow_android_version_arr)) {
return array();
}
}
} //ios版本限制
if (isset($return['ios_version']) && $return['ios_version']) {
if ($params->{self::KEY_CLIENT_ID} == '1') {
$allow_ios_version_arr = explode(',', $return['ios_version']);
if (!in_array($params->{self::KEY_VERSION}, $allow_ios_version_arr)) {
return array();
}
}
} //运营商限制
if (isset($return['operator']) && !empty($return['operator']) && !in_array($operator, $return['operator'])) {
return array();
} //地市限制
if (isset($return['region']) && !empty($return['region'])) {
$sign = false;
foreach ($return['region'] as $region) {
if ($region[0] == "" || ($region[0] == $provinceId && ($region[1] == "" || $region[1] == $cityId))) {
$sign = true;
break;
}
}
if ($sign == false) {
return array();
}
} if ($return['switchValue'] == 1) { //无弹框
return array();
} elseif ($return['switchValue'] == 2) { //微力活动弹框
$param = array('mobi' => $mobile); if (isset($return['whost']) && $return['whost']) {
$url = $return['whost'];
} else {
$_conf = Rpc_Context::getConfig();
$config = include ($_conf['config_path'] . 'wxactivity.config.php');
$host = $config['hosts'][APPLICATION_ENV];
$url = rtrim($host, '/').'/open/txl_api/multi_call_popup';
} $h = new Util_Curl($url); $r = $h->httpPost($param, false, array('content-type:application/x-www-form-urlencoded'))->getResponse(); $result = json_decode($r, true); if (isset($result['code']) && $result['code'] == 0) {
return array(
'id' => strval($result['data']['id']),
'title' => $result['data']['title'],
'content' => $result['data']['content'],
'link' => $result['data']['button_url'],
'text' => $result['data']['button_name'],
);
} else {
return array();
}
} else { //自定义弹框
return $return['defineActivityInfo'];
}
}

适配服务请求pms平台

E:\html\pim\php_aspire-mcloud\configure\officialdb.config.php

<?php
return array(
'hosts' => array(
'development' => 'http://pms.svn.com',//本地svn环境
'qa' => 'http://pms.qa.cytxl.com.cn',//10.9.20.65 pms.qa.cytxl.com.cn
'test' => 'http://pms.cytxl.com.cn', //192.168.19.32 pms.cytxl.com.cn
'production' => 'http://pms.cytxl.com.cn' //172.16.79.10 pms.cytxl.com.cn
),
'appkey' => '470004',
);
mysql --default-character-set=utf8 -utxl_pms_user -h192.168.2.116 -ppms#@139com! -P3307 -D txl_pms
mysql> select content from config where type = 'activity_popup_config_plus';
{"switchValue":"2","defineActivityInfo":{"id":"haha","title":"\u5f55\u54e5\u6709\u793c\u8fd9\u662f\u4e0d\u80fd\u4e2d\u5956\u7684\u94fe\u63a5\u7eaf\u6d4b\u5f39\u7a97","content":"\u606d\u559c\u5c0f\u4e3b\u83b7\u5f97300\u5206\u949f\u591a\u65b9\u7535\u8bdd~ \u798f\u5229\u5df2\u53d1\u51fa~","link":"http:\/\/1.activity.cytxl.com.cn\/static\/html\/super_lottery\/h5\/multi_call\/index.html?super_lottery_id=48","text":"\u731b\u6233\u9886\u53d6"},"whost":"","android_version":"","ios_version":"","operator":["CM","CT","CU"],"region":[["",""]]}

适配服务请求微力平台

E:\html\pim\php_aspire-mcloud\configure\wxactivity.config.php

<?php
/**
* 微力活动 配置参数
*/
return array(
'hosts' => array(
'development' => 'http://1.activity.cytxl.com.cn',
'qa' => 'http://1.activity.cytxl.com.cn',
'test' => 'https://activity1.cytxl.com.cn',
'production' => 'https://activity.cytxl.com.cn'
),
);

E:\html\pim\php_weili_activities\application\controllers\open\txl_api.php

    public function multi_call_popup(){
$mobi = $this->input->post('mobi'); $multi_call = $this->super_lottery_model->get_multi_call();
if (!$multi_call){
return $this->send_json(false,'查无活动信息或不在活动时间内');
} $limit_goal_arr = array(
'super_lottery_id'=>$multi_call->id,
'prize_type !='=>SPLT_PRIZE_TYPE_THANKS,
'mobi' => $mobi,
); $goal_counts = $this->super_lottery_result_model->count('',$limit_goal_arr);
if ($goal_counts > 0) { //已中奖
return $this->send_json(false,'用户已中奖!');
} $ret = array(
'id' => strval($multi_call->id),
'title' => $multi_call->pop_up_title,
'point'=>'',
'content'=>$multi_call->pop_up_content,
'button_name'=>$multi_call->pop_up_button_name,
'button_url'=>base_url('static/html/super_lottery/h5/multi_call/index.html?super_lottery_id='.$multi_call->id)
); return $this->send_json(true,'',$ret); }

最新文章

  1. C++中 引入虚基类的作用
  2. Oracle 11g XE release2安装与指导
  3. Java接口、Java抽象类、C++抽象类的区别
  4. C#获取一个文件的扩展名
  5. Bash简单介绍
  6. N - Robot Motion(第二季水)
  7. Broker模块划分
  8. Coin Change (II)(完全背包)
  9. C# 程序集安装与卸载
  10. JavaEE GenericServlet 解析
  11. 【Linux学习笔记】关于ubuntu开机菜单栏和任务栏不见了的有效解决方法
  12. JAVA之字符串
  13. 洛谷p3800:Power收集
  14. redux&amp;&amp;createStore
  15. python3 urllib 类
  16. remote:error:refusing to update checked out branc
  17. js判断PC端还是移动端
  18. java 偏向锁、轻量级锁及重量级锁synchronized原理
  19. wampserver安装
  20. Stm32 资料

热门文章

  1. 机器学习算法实现解析——libFM之libFM的训练过程之Adaptive Regularization
  2. python中封装
  3. 正确设置Firefox下载文件文件名的方法
  4. php安装完后配置php.ini和php-fpm.conf
  5. querySelector.. 方法相比 getElementsBy..
  6. CF1114F Please, another Queries on Array?
  7. python 之 list,tuple,dict,set
  8. Codeforces Round #249 (Div. 2)-D
  9. C#类、方法的访问修饰符
  10. centos65安装docker遇到的问题