Commit 849551af authored by liuyuzhen's avatar liuyuzhen

合并代码

parents d76db5a9 4458d513
......@@ -715,15 +715,28 @@ class OrderConfirmUtil {
$authInfo = $sess->get('wxAuthInfo');
$openid = $authInfo['openid'];
$req_data = array('touser'=>$openid, 'template_id'=> $msg_tpl, 'form_id'=>$formId,
'page'=> 'pages/orders/detail/index?id=' . $orderId,
'data'=>array(
$tpl_datas = array();
if($msg_tpl=='G7R8NV0eLQGJhyBbbbYvdoaY6vLgi47s4kpOK0oACUA') {
$tpl_datas = array(
'keyword1'=>array('value'=>'下单成功'),
'keyword2'=>array('value'=> $order['order_sn']),
'keyword3'=>array('value'=> number_format($order['order_amount']/100, 2).'元'),
'keyword4'=>array('value'=> $order['store_name']),
'keyword5'=>array('value'=> $goods_str),
));
);
} else {
$tpl_datas = array(
'keyword1'=>array('value'=>'下单成功'),
'keyword2'=>array('value'=> $order['order_sn']),
'keyword3'=>array('value'=> date('Y-m-d H:i', TIMESTAMP)),
'keyword4'=>array('value'=> number_format($order['order_amount']/100, 2).'元'),
'keyword5'=>array('value'=> $order['store_name']),
'keyword6'=>array('value'=> $goods_str),
);
}
$req_data = array('touser'=>$openid, 'template_id'=> $msg_tpl, 'form_id'=>$formId,
'page'=> 'pages/orders/detail/index?id=' . $orderId,
'data'=>$tpl_datas);
// \Our\Log::getInstance()->write(json_encode($req_data), '/data/log/apptest');
$json = $wechatCommon->sendTemplateMessage($access_token, $req_data);
// \Our\Log::getInstance()->write($json, '/data/log/apptest');
......
......@@ -70,6 +70,20 @@ class Common
}
return false;
}
/**
* @param $arr
* @param $key_name
* @return array
* 将数据库中查出的列表以指定的 id 作为数组的键名
*/
public static function convertArrKey($arr, $key_name)
{
$arr2 = array();
foreach ($arr as $key => $val) {
$arr2[$val[$key_name]] = $val;
}
return $arr2;
}
public static function isSerialized($data)
{
......
......@@ -275,8 +275,10 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach($storeIds as $key){
$tempReturnCart = $result[$key];
$tempStore = $storeDao->get($key,false,false);
$tempReturnCart['inAreaFlag'] = $storeDao->checkAddressInServiceArea($address,$tempStore);
$newResult[] = $tempReturnCart;
if($tempStore) { //如果存在店铺数据
$tempReturnCart['inAreaFlag'] = $storeDao->checkAddressInServiceArea($address,$tempStore);
$newResult[] = $tempReturnCart;
}
}
return array('totalCount'=>count($storeCartList),'list'=>$newResult);
}
......@@ -1206,4 +1208,4 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
}
}
\ No newline at end of file
}
......@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
public function updateGoodsStoregeByGoodsIds($storeId,$goodsid,$num=ApiConst::zero,$type=ApiConst::plus){
if(is_array($goodsid)){
$where['goods_id']=array('in',$goodsid);
$goodsids=array($goodsid);
$convertGoodsId=Common::convertArrKey($goodsid,'goodsId');
$where['goods_id']=array('in',$goodsids);
}else{
$where['goods_id']=$goodsid;
}
......@@ -1206,8 +1208,14 @@ class OrderServiceModel extends \Business\AbstractModel
$goodsDao = \DAO\GoodsModel::getInstance(DbNameConst::masterDBConnectName);
$goodses=$goodsDao->getList($where,$goodsDao->goodsDetailField);
if(!empty($goodses)){
foreach($goodses as &$goods){
if(is_array($goodsid)){
foreach($goodses as &$goods){
$goods['goodsNum']=$convertGoodsId[$goods['goodsId']]['num'];
}
}else{
foreach($goodses as &$goods){
$goods['goodsNum']=$num;
}
}
if($this->updateDateGoodsStoregeByOrderGoods($goodses,$type,false)){
return true;
......
......@@ -1011,7 +1011,7 @@ class StoreServiceModel extends \Business\AbstractModel{
foreach($signClassStores as $signClass){
$inAreaFlag = \Our\CommonExtension::locationInArea($position['lat'],$position['lng'],$signClass['sign_scope']);
if($inAreaFlag){
if($return[$signClass['gc_id']]){
if(isset($return[$signClass['gc_id']])){
continue;
}
$return[$signClass['gc_id']] = $signClass['store_id'];
......
......@@ -12,10 +12,7 @@ application.dispatcher.catchException = true
; Admin模块用于后台管理
application.modules = Index,Api,Admin,Client
redis.redisPublishName='redisPublish';
redis.redisPublishName='redisPublish'
[productone : common]
; 数据库配置
......@@ -63,7 +60,7 @@ elastic.master.port="9200"
elastic.master.scheme="http";
password.key='~!@#$`1234qwertasdfgzxcvb';
//生产环境
;生产环境
[product : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
......@@ -453,7 +450,7 @@ elastic.master.scheme="http";
resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "127.0.0.1"
resources.database.params.port = 3306
resources.database.params.database = "testqmcs"
resources.database.params.database = "qmcs"
resources.database.params.username = "root"
resources.database.params.password = "123456"
resources.database.params.charset = "UTF8"
......@@ -463,7 +460,7 @@ 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 = "testqmcs"
resources.database.slave.params.database = "qmcs"
resources.database.slave.params.username = "root"
resources.database.slave.params.password = "123456"
resources.database.slave.params.charset = "UTF8"
......
......@@ -43,7 +43,12 @@ class cliOrderClose extends basecli
protected function autoCloseOrder(){
$orderService=\Business\Order\OrderServiceModel::getInstance(\Our\DbNameConst::masterDBConnectName);
$orderService->baseDir= \Our\Common::getConfig('out.config');
$orderService->changeOrderStatusSecond();
if($this->aArgv[1]){
$orderService->changeOrderStatusSecond(true);
}else{
$orderService->changeOrderStatusSecond();
}
$messageService=\Business\Message\MessageServiceModel::getInstance(\Our\DbNameConst::masterDBConnectName);
$messageService->addMessageCenterToDb();
}
......
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