Commit 075b3620 authored by testshenbd's avatar testshenbd

conflicts

parents aebd8775 b9181838
......@@ -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)
{
......
......@@ -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;
......
......@@ -12,6 +12,8 @@ application.dispatcher.catchException = true
; Admin模块用于后台管理
application.modules = Index,Api,Admin,Client
redis.redisPublishName='redisPublish'
[productone : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
......@@ -534,4 +536,4 @@ 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
;resources.database.params.password = "password"
......@@ -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