Commit bba76ae2 authored by wwccw0591's avatar wwccw0591

pc

parent c644aa8f
......@@ -52,7 +52,6 @@ class IndexController extends \Our\Controller_Abstract {
}
public function indexAction() {
echo 1;exit;
$orderDao = \DAO\Order\OrderModel::getInstance();
$res=$orderDao->getList(array('buyer_id'=>1),'*',0,10);
......
<?php
use Business\User\LoginV2Model;
use Business\Message\MessageServiceModel;
class IndexController extends \Our\Controller_Abstract {
public $req;
public $memberId;
public $messageService;
public function init(){
}
public function is_https() {
if ( !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') {
return true;
} elseif ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) {
return true;
} elseif ( !empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') {
return true;
}elseif($_SERVER['SERVER_PORT'] == 89){
return true;
}
return false;
}
public function getHtmlAction(){
$this->req=$this->getRequest()->getQuery();
$postData=$this->req;
$postData=base64_decode($postData[\Our\NameConst::sessionKey]);
$params=explode(\Our\PathConst::cutVertical,$postData);
$this->key=$params[0];
session_id($this->key);
$this->sess=\Yaf\Session::getInstance();
$this->sess->start();
if($this->sess['key']!=$this->key){
echo 'error auth!';
exit;
// ErrorModel::throwException(CodeConfigModel::authExpire);
}
$this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
$paramsStr= $this->memberDb0Redis->tablelpop($this->key);
$paramsStr=json_decode($paramsStr,true);
$this->_view->assign("params", $paramsStr);
if($paramsStr['type']==\Our\ApiConst::sharePlat){
$this->_view->display('index/plat.phtml');
}
if($paramsStr['type']==\Our\ApiConst::shareStore){
$this->_view->display('index/store.phtml');
}
if($paramsStr['type']==\Our\ApiConst::shareGoods){
$this->_view->display('index/goods.phtml');
}
exit;
}
public function indexAction() {
echo 1;exit;
$orderDao = \DAO\Order\OrderModel::getInstance();
$res=$orderDao->getList(array('buyer_id'=>1),'*',0,10);
echo json_encode($res);exit;
//$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsBrowserRedisModel::getInstance(),array(&$browseDAO, 'getDistinctDate'),array($memberId,$startTime,$endTime,$order),\Our\ApiConst::twoMinSecond,array($memberId));
// $clientPush=\JPush\ClientPush::getInstance();
// $clientPush->pushAll();
$mongoDb= new \Mongo\MongoDbModel();
$res= $mongoDb->insert('message_history',array('id'=>1,'name'=>'chenchuanwen'));
echo json_encode($res);
exit;
\Our\Log::getInstance()->write('testLog|||||testLog');
var_dump($_SERVER);exit;
// echo $_SERVER['USER']);exit;
$elasticConfig=\Our\Common::getConfig('elastic.master');
$configArray=array(
$elasticConfig->host.':'.$elasticConfig->port,
);
$client=\Elasticsearch\ClientBuilder::create()->setHosts($configArray)->build();
$res=array(
'id'=>'nignx-log*',
'index'=>'.kibana',
'type'=>'index-pattern'
);
$res=$client->getSource($res);
echo json_encode($res);
exit;
}
public function check(){
$this->req=$this->getRequest()->getPost();
$this->checkEncrypt();
if(empty($this->req['data']['key'])){
\Error\ErrorModel::throwException(CodeConfigModel::illegalAccess);
}
session_id($this->req['data']['key']);
ini_set('session.gc_maxlifetime', \Our\ApiConst::tenDaySecond);
$sess=\Yaf\Session::getInstance();
$sess->start();
$this->memberId=$sess->get('member_id');
if(empty($this->memberId)){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noLogin);
}
//\Yaf\Dispatcher::getInstance()->disableView();
}
public function chatRoomAction(){
$this->check();
$this->messageService=MessageServiceModel::getInstance();
$pageIndex=isset($this->req['data']['pageIndex'])?$this->req['data']['pageIndex']:0;
$pageSize=isset($this->req['data']['pageSize'])?$this->req['data']['pageSize']:20;
if(!empty($this->req['data']['toType'])){
$returnMessage=\Our\RedisHelper::cachedFunction(\Redis\Db15\MessageRedisModel::getInstance(),array(&$this->messageService, 'getMemberList'),array($this->memberId,$this->req['data']['fromType'],$this->req['data']['toId'],$this->req['data']['toType'],'*',$pageIndex,$pageSize),3600,array($this->memberId));
}else{
$returnMessage=\Our\RedisHelper::cachedFunction(\Redis\Db15\MessageRedisModel::getInstance(),array(&$this->messageService, 'getList'),array($this->memberId,$pageIndex,$pageSize),1,array($this->memberId));
}
$push= \Yaf\Registry::get('config')->get('push');
$pushUrl=$push['clientHost'];
$this->_view->assign("key",$this->req['data']['key']);
$this->_view->assign('users',$returnMessage['list']);
$this->_view->assign('memberId',$this->memberId);
$this->_view->assign('pushUrl',$pushUrl);
$this->_view->assign('totalCount',$returnMessage['totalCount']);
}
public function goodsDetailAction() {
$goodsCommonId=(int)$this->getRequest()->getQuery()['goodsCommonId'];
if($goodsCommonId > 0) {
$commonGoodsInstance = \DAO\GoodsCommonModel::getInstance();
$commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonGoodsInstance, 'getOneById'),array($goodsCommonId),0,array($goodsCommonId));
}
$this->_view->assign('commonInfo',$commonInfo);
}
}
......@@ -406,4 +406,51 @@ push.user.service.type=7
elastic.master.host="192.168.1.201"
elastic.master.port="9200"
elastic.master.scheme="http";
\ No newline at end of file
elastic.master.scheme="http";
[linqing : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "127.0.0.1"
resources.database.params.port = 3306
resources.database.params.database = "qmcs"
resources.database.params.username = "root"
resources.database.params.password = "123456"
resources.database.params.charset = "UTF8"
resources.database.params.driver_options.1002 = "SET NAMES utf8"
; 从库配置
resources.database.slave.params.driver = "pdo_mysql"
resources.database.slave.params.hostname = "127.0.0.1"
resources.database.slave.params.port = 3306
resources.database.slave.params.database = "qmcs"
resources.database.slave.params.username = "root"
resources.database.slave.params.password = "123456"
resources.database.slave.params.charset = "UTF8"
resources.database.slave.params.driver_options.1002 = "SET NAMES utf8"
redis.database.params.host = "127.0.0.1"
redis.database.params.port = "6379"
redis.database.params.prefix = "qm_"
redis.database.params.password = "23456ertyu"
out.config="/data/config";
;锁文件
out.locks="/data/locks";
; redis配置
;redis.database.params.password = "test"
;推送配置
push.clientHost="ws://192.168.80.18:9502"
push.host="192.168.80.18"
push.port="9503"
push.open=1
push.user.service.id=293
push.user.service.type=7
elastic.master.host="192.168.1.201"
elastic.master.port="9200"
elastic.master.scheme="http";
;resources.database.params.hostname = "127.0.0.1"
;resources.database.params.database = "database"
;resources.database.params.username = "username"
;resources.database.params.password = "password"
\ No newline at end of file
......@@ -167,4 +167,41 @@ config.url.pushHost="127.0.0.1:9503";
config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
\ No newline at end of file
config.url.libary="/www/local.qm.com/application/library"
[linqing : common]
; url相关配置
config.url.resourcesHost = "http://local.qm.com"
; 用户中心host
config.url.userHost = ""
; oss 域名
config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
; 文件目录
[ccw : common]
; url相关配置
config.url.resourcesHost = "http://local.qm.com"
; 用户中心host
config.url.userHost = ""
; oss 域名
config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
; 文件目录
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment