Commit f31b6b18 authored by zhz's avatar zhz

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into master_dev

parents 11432ed0 7306131f
...@@ -135,7 +135,7 @@ class MessageController extends \Our\Controller_AbstractApi { ...@@ -135,7 +135,7 @@ class MessageController extends \Our\Controller_AbstractApi {
public function getUnreadCountAction(){ public function getUnreadCountAction(){
$messageService = \Business\Message\MessageServiceModel::getInstance(); $messageService = \Business\Message\MessageServiceModel::getInstance();
$unreadCount=$messageService->getUnreadCountByMemberIdAndType($this->memberId); $unreadCount=$messageService->getUnreadCountByMemberIdAndType($this->memberId);
$this->success(array('unreadCount'=>$unreadCount)); $this->success(array('unreadCount'=>(int)$unreadCount));
} }
public function setAction(){ public function setAction(){
$messageService = \Business\Message\MessageServiceModel::getInstance(); $messageService = \Business\Message\MessageServiceModel::getInstance();
......
...@@ -191,7 +191,8 @@ class Push ...@@ -191,7 +191,8 @@ class Push
} }
public function getOrderMessageContent($orderDetail){ public function getOrderMessageContent($orderDetail){
$messageContent='商品名称:'; $messageContent='订单号:'.$orderDetail['orderSn']."\n";
$messageContent.='商品名称:';
foreach($orderDetail['orderGoods'] as $orderGood){ foreach($orderDetail['orderGoods'] as $orderGood){
$messageContent.=$orderGood['goodsName'].'×'.$orderGood['goodsNum']."\n"; $messageContent.=$orderGood['goodsName'].'×'.$orderGood['goodsNum']."\n";
} }
......
...@@ -1163,14 +1163,19 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -1163,14 +1163,19 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if(($storeIds&&in_array($storeId,$storeIds))){ if(($storeIds&&in_array($storeId,$storeIds))){
continue; continue;
} }
$topSaleListTemp=$storeTopSaleGoodsModel->getStoreTopSaleGoodsListByStoreId($storeId); $storeIds[] = $storeId;
$topSaleListTemp = $storeTopSaleGoodsModel->getStoreTopSaleGoodsListByStoreId($storeId);
$storeTopSaleList = $this->getNewStoreTopSaleGoodsList($topSaleListTemp,$storeId); $storeTopSaleList = $this->getNewStoreTopSaleGoodsList($topSaleListTemp,$storeId);
$topSaleList = $topSaleList?array_merge($topSaleList,$storeTopSaleList):$storeTopSaleList; $topSaleList = $topSaleList?array_merge($topSaleList,$storeTopSaleList):$storeTopSaleList;
} }
} }
if($topSaleList){ if($topSaleList){
$result = $storeTopSaleGoodsModel->insertAllOrUpdate($topSaleList); $result = $storeTopSaleGoodsModel->insertAllOrUpdate($topSaleList);
\Our\Log::getInstance()->write('店铺销量更新'.($result?'success':'fail')); $storeTopSaleGoodsRedis = \Redis\Db4\StoreTopSaleGoodsRedisModel::getInstance();
foreach($storeIds as $tempStoreId){
$storeTopSaleGoodsRedis->tableDel($tempStoreId);
}
\Our\Log::getInstance()->write('店铺销量前三更新'.($result?'success':'fail'));
} }
\Our\Log::getInstance()->write('本次没有店铺数据需要更新'); \Our\Log::getInstance()->write('本次没有店铺数据需要更新');
} }
......
...@@ -63,7 +63,7 @@ class StoreTopSaleGoodsModel extends \DAO\AbstractModel{ ...@@ -63,7 +63,7 @@ class StoreTopSaleGoodsModel extends \DAO\AbstractModel{
}else{ }else{
$singleStoreGoods = $this->getList(array('store_id'=>$storeId,'goods_commonid'=>array('neq',''))); $singleStoreGoods = $this->getList(array('store_id'=>$storeId,'goods_commonid'=>array('neq','')));
if($singleStoreGoods){ if($singleStoreGoods){
$ordesGoods = empty($orderGoods)?$singleStoreGoods:array_merge($orderGoods,$singleStoreGoods); $orderGoods = empty($orderGoods)?$singleStoreGoods:array_merge($orderGoods,$singleStoreGoods);
$storeTopSaleGoodsRedis->update($storeId,$singleStoreGoods,\Our\ApiConst::oneDaySecond); $storeTopSaleGoodsRedis->update($storeId,$singleStoreGoods,\Our\ApiConst::oneDaySecond);
} }
} }
...@@ -93,8 +93,17 @@ FROM han_goods_common t1 where t1.goods_state={1} and t1.goods_verify={2} and t1 ...@@ -93,8 +93,17 @@ FROM han_goods_common t1 where t1.goods_state={1} and t1.goods_verify={2} and t1
) a ) a
left join han_goods_score_statistics b left join han_goods_score_statistics b
on a.goods_commonid = b.goods_commonid on a.goods_commonid = b.goods_commonid
WHERE a.group_id<=3 AND a.sale_num>0 ',\Our\ApiConst::defaultGoodsScore,\Our\ApiConst::onlineGoodsState,\Our\ApiConst::onlineGoodsVerify,$storeId,\Our\ApiConst::onlineGoodsDel); WHERE a.group_id<=3 AND a.sale_num>0 order by a.group_id asc limit 3',\Our\ApiConst::defaultGoodsScore,\Our\ApiConst::onlineGoodsState,\Our\ApiConst::onlineGoodsVerify,$storeId,\Our\ApiConst::onlineGoodsDel);
$list = $this->db->query($sql)->rows; $list = $this->db->query($sql)->rows;
if($list){
$newlist = array();
foreach($list as $key=>$goods){
$goods['rank'] = $key+1;
$newlist[] = $goods;
}
return $newlist;
}
return $list; return $list;
} }
......
...@@ -318,7 +318,7 @@ elastic.master.host="192.168.1.201" ...@@ -318,7 +318,7 @@ elastic.master.host="192.168.1.201"
elastic.master.port="9200" elastic.master.port="9200"
elastic.master.scheme="http"; elastic.master.scheme="http";
[lyz : common] [lyztest : common]
; 数据库配置 ; 数据库配置
resources.database.params.driver = "pdo_mysql" resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "127.0.0.1" resources.database.params.hostname = "127.0.0.1"
...@@ -363,7 +363,7 @@ elastic.master.host="192.168.1.201" ...@@ -363,7 +363,7 @@ elastic.master.host="192.168.1.201"
elastic.master.port="9200" elastic.master.port="9200"
elastic.master.scheme="http"; elastic.master.scheme="http";
[lyztest : common] [lyz : common]
; 数据库配置 ; 数据库配置
resources.database.params.driver = "pdo_mysql" resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "127.0.0.1" resources.database.params.hostname = "127.0.0.1"
......
<?php <?php
phpinfo();exit; $www_file = '/home/wwwroot/mysite/';
$redis =new Redis();
$redis->connect('127.0.0.1','6379'); //打开网站目录下的hooks.log文件 需要在服务器上创建 并给写权限
$redis->rPush('test',0);
$res=$redis->lPop('test'); $fs = fopen($www_file . 'hooks.log', 'a');
var_dump($res);
fwrite($fs, '================ Update Start ===============' . PHP_EOL . PHP_EOL);
?>
//自定义字串掩码 用于验证
$access_token = 's7kjjhh8767laq29KLJK9089883hjjkgfdrrpipoinmw';
//接受的ip数组,也就是允许哪些IP访问这个文件 这里是gitlab服务器IP
$access_ip = array('8.8.8.8');
//获取请求端的ip和token
$client_token = $_GET['token'];
$client_ip = $_SERVER['REMOTE_ADDR'];
//把请求的IP和时间写进log
fwrite($fs, 'Request on [' . date("Y-m-d H:i:s") . '] from [' . $client_ip . ']' . PHP_EOL);
//验证token 有错就写进日志并退出
if ($client_token !== $access_token) {
echo "error 403";
fwrite($fs, "Invalid token [{$client_token}]" . PHP_EOL);
exit(0);
}
//验证ip
if (!in_array($client_ip, $access_ip)) {
echo "error 503";
fwrite($fs, "Invalid ip [{$client_ip}]" . PHP_EOL);
exit(0);
}
//获取请求端发送来的信息,具体格式参见gitlab的文档
$json = file_get_contents('php://input');
$data = json_decode($json, true);
//如果有需要 可以打开下面,把传送过来的信息写进log
//fwrite($fs, 'Data: '.print_r($data, true).PHP_EOL);
//执行shell命令并把返回信息写进日志
$output = shell_exec("cd $www_file &;&; git checkout master &;&; git pull origin master 2>&;1");
fwrite($fs, 'Info:' . $output . PHP_EOL);
fwrite($fs, PHP_EOL . '================ Update End ===============' . PHP_EOL . PHP_EOL);
$fs and fclose($fs);
//网站目录$www_file='/home/wwwroot/mysite/';//打开网站目录下的hooks.log文件 需要在服务器上创建 并给写权限$fs = fopen($www_file.'hooks.log', 'a');fwrite($fs, '================ Update Start ==============='.PHP_EOL.PHP_EOL);//自定义字串掩码 用于验证$access_token = 's7kjjhh8767laq29KLJK9089883hjjkgfdrrpipoinmw';//接受的ip数组,也就是允许哪些IP访问这个文件 这里是gitlab服务器IP$access_ip = array('8.8.8.8');//获取请求端的ip和token$client_token = $_GET['token'];$client_ip = $_SERVER['REMOTE_ADDR'];//把请求的IP和时间写进logfwrite($fs, 'Request on ['.date("Y-m-d H:i:s").'] from ['.$client_ip.']'.PHP_EOL);//验证token 有错就写进日志并退出if ($client_token !== $access_token){echo "error 403";fwrite($fs, "Invalid token [{$client_token}]".PHP_EOL);exit(0);}//验证ipif ( !in_array($client_ip, $access_ip)){echo "error 503";fwrite($fs, "Invalid ip [{$client_ip}]".PHP_EOL);exit(0);}//获取请求端发送来的信息,具体格式参见gitlab的文档$json = file_get_contents('php://input');$data = json_decode($json, true);//如果有需要 可以打开下面,把传送过来的信息写进log//fwrite($fs, 'Data: '.print_r($data, true).PHP_EOL);//执行shell命令并把返回信息写进日志$output=shell_exec("cd $www_file &;&; git checkout master &;&; git pull origin master 2>&;1");fwrite($fs, 'Info:'. $output.PHP_EOL);fwrite($fs,PHP_EOL. '================ Update End ==============='.PHP_EOL.PHP_EOL);$fs and fclose($fs);
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