Commit e06a4226 authored by wwccw0591's avatar wwccw0591

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

parents f6e703ee fe2ff506
......@@ -58,6 +58,10 @@ class CommonController extends \Our\Controller_AbstractIndex{
}
public function getSettingAction(){
$setting = \Business\Common\SettingServiceModel::getInstance()->getSetting();
$this->success($setting);
}
public function getProblemListAction(){
$commonProbleService = \Business\Common\CommonProblemServiceModel::getInstance();
......
......@@ -92,7 +92,7 @@ class IndexController extends \Our\Controller_Abstract {
}
public function goodsDetailAction() {
$goodsCommonId=(int)$this->getRequest()->getQuery()['goodsCommonid'];
$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));
......
......@@ -11,8 +11,8 @@ class ApiConst
const randLengh = 8;
//10天数秒
// const tenDaySecond = 864000;
const tenDaySecond = 300;
const tenDaySecond = 86400;
//const tenDaySecond = 300;
//一天
const oneDaySecond = 86400;
//半天
......
......@@ -153,6 +153,9 @@ class NameConst {
const elasticName='elastic.master';
const shopkeeper='shopkeeper';
const cancelUnPayedOrderTimePrefix = 'cancelUnPayedOrderTime';
const cancelUnReceivedOrderTimePrefix = 'cancelUnReceivedOrderTime';
}
?>
\ No newline at end of file
......@@ -826,7 +826,7 @@ class CartServiceModel extends \Business\AbstractModel{
$delivery['deliveryFee'] = $deliveryFee;
$deliverySettings[]= $delivery;
}
if($deliverySetting['buyerDistribution']=\Our\ApiConst::one){
if($deliverySetting['buyerDistribution']==\Our\ApiConst::one){
$deliveryFee = \Our\ApiConst::zero;//到店自提
$delivery = array();
$delivery['name'] = \Our\DescribeConst::deliveryNameBuyer;
......
......@@ -9,7 +9,8 @@ class SettingServiceModel extends \Business\AbstractModel{
$settingDAO = \DAO\SettingModel::getInstance();
$type == 0 ? $version = $settingDAO->getListCache(array('android_version','android_apk')) : $version = $settingDAO->getListCache(array('ios_version'));
if($version['android_version']) {
return array('version'=>$version['android_version'],'url'=>'http://qm.22ca.com/mall/index.php?act=desc&op=upload&file_name='.$version['android_apk']);
$host = 'http://testadmin.shenbd.com';
return array('version'=>$version['android_version'],'url'=>$host . '/mall/index.php?act=desc&op=upload&file_name='.$version['android_apk']);
}
return array('version'=>$version['ios_version']);
}
......@@ -19,6 +20,19 @@ class SettingServiceModel extends \Business\AbstractModel{
$phone = $settingDAO->getListCache(array('qm_service_phone'))['qm_service_phone'];
return array('servicePhone'=>$phone);
}
public function getSetting(){
$settingDAO = \DAO\SettingModel::getInstance();
$setting = $settingDAO->getListCache(array('unpayed_order_close_minutes','unreceived_order_close_minutes'));
$return = array();
if($setting['unpayed_order_close_minutes']){
$return['unpayedOrderColseTime'] = (int)$setting['unpayed_order_close_minutes'];
}
if($setting['unreceived_order_close_minutes']){
$return['unreceivedOrderColseTime'] = (int)$setting['unreceived_order_close_minutes'];
}
return $return;
}
private static $_instance = null;
/**
......
......@@ -24,7 +24,7 @@ class CommentServiceModel extends \Business\AbstractModel {
if(is_array($list) && !empty($list)){
$totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db6\CommentToBuyerRedisModel::getInstance(),array(&$CommentToBuyerDAO, 'getCount'),array($where),\Our\ApiConst::oneMinute,array($memberId));
foreach ($list as $v){
$comments[] = array('id'=>$v['id'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'content'=>$v['content'],'state'=>$v['state'],'addTime'=>$v['addtime']);
$comments[] = array('id'=>$v['id'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'content'=>$v['content'],'state'=>$v['state'],'addTime'=>$v['addtime']);
}
}else{
$totalCount = 0;
......
......@@ -18,7 +18,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
}
$goods = [];
foreach ($orderGoods as $k=>$v){
$goods[] = array('goodsId'=>$v['goods_id'],'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_pay_price'],'goodsNum'=>$v['goods_num'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']));
$goods[] = array('goodsId'=>$v['goods_id'],'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_pay_price'],'goodsNum'=>$v['goods_num'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']));
}
$serviceEvaluations = [];
if($order['diliveryman_id']) {
......
......@@ -139,7 +139,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonDAO = \DAO\GoodsCommonModel::getInstance();
foreach ($list as $v){
unset($v['goods_price']);
$v['goodsImage'] = $commonDAO->getGoodsImgSrc($v['goodsImage']);
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
$v['goodsPrice'] = (int)$v['goodsPrice'];
$goodsList[] = $v;
}
......@@ -261,7 +261,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if(is_array($list) && !empty($list)){
$totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getCount'),array(implode(' and ',$where),$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
foreach ($list as $v){
$v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360);
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
$v['goodsPrice'] = (int)$v['goodsPrice'];
unset($v['goods_price']);
$goods[] = $v;
......@@ -285,7 +285,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goodsCommonId = intval($param['goodsCommonId']);
$attrs = $this->getAttr($goodsCommonId,$memberId);
$commonInfo = $attrs['commonInfo'];
$commonInfo['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($commonInfo['goods_image']);
$commonInfo['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($commonInfo['goods_image']);
//所在地
$area = '';
......@@ -326,14 +326,14 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$attrbuteDAO = \DAO\GoodsAttributeModel::getInstance();
$productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId));
$html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>'http://qm.22ca.com/mall/index.php?act=desc&op=getDes&goodsCommonId='.$goodsCommonId);
$html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>'/index/goodsDetail?goodsCommonId='.$goodsCommonId);
unset($attrs['commonInfo']);
return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url']),$attrs);
}
public function getAttr($goodsCommonId,$memberId = null){
$goodsCommonId = (int)$goodsCommonId;
$commonInfo = $this->checkGoodsCommon($goodsCommonId);
$commonInfo['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($commonInfo['goods_image']);
$commonInfo['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($commonInfo['goods_image']);
//该用户是否有参加销售活动
//$activities = $this->isJoin($commonInfo['store_id'],$memberId);
$activities = \DAO\SaleMemberModel::getInstance()->isJoinStore($commonInfo['store_id'],$memberId);
......@@ -348,7 +348,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if($image && is_array($image)){
$i = 0;
foreach ($image as $k=>$v){
$image[$k]['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image'],1280);
$image[$k]['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($v['goods_image'],1280);
$attrImage[$v['attr_name']][$v['attr_value']][] = $image[$k]['goods_image'];
if($i < 5 ){
$images[] = $image[$k]['goods_image'];
......@@ -476,7 +476,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
// $goods = [];
// if(is_array($goodsList) && !empty($goodsList)){
// foreach ($goodsList as $v){
// $v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360);
// $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
// $v['goodsPrice'] = (int)$v['goodsPrice'];
// unset($v['goods_price']);
// $goods[] = $v;
......@@ -968,7 +968,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goods[] = [
'goodsCommonId'=>$v['goods_commonid'],
'goodsName'=>$v['goods_name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image'],360),
'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image'],360),
'goodsMarketPrice'=>$v['goods_marketprice'],
'goodsPrice'=>$v['goods_price']
];
......
......@@ -41,7 +41,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data['image'] = [];
if($blImg = unserialize($data['bl_image'])){
foreach ($blImg as $v){
$data['image'][] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v,1280);
$data['image'][] = \Our\ImageUtil::getGoodsImgUrl($v,1280);
}
}
$data['goods'] = [];
......
......@@ -301,7 +301,7 @@ class OrderServiceModel extends \Business\AbstractModel
$return['expressImage'] = Common::getStaticFile($shippingExpressInfo['eImage'], ImageConst::expressPath);
$return['goodsName'] = $orderGoods['goodsName'];
$return['goodsId'] = $orderGoods['goodsId'];
$return['goodsImage'] = $goodsCommonDao->getGoodsImgSrc($orderGoods['goodsImage'], ArrayConst::goodsImageExt[ApiConst::goodsSmallSize]);
$return['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($orderGoods['goodsImage'], ArrayConst::goodsImageExt[ApiConst::goodsSmallSize]);
$return['goodsAttr'] = $goodsDao->getFormatGoodsAttr($orderGoods['goodsSpec']);
$return['orderPrice'] = $order['orderAmount'];
$return['expressInfo'] = $order['shippingHtml'] ? unserialize($order['shippingHtml']) : array();
......
......@@ -394,7 +394,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$res = file_get_contents($this->baseDir .PathConst::orderPaymentTimeConf);
$this->lastOrderId = !empty($res) ? $res : ApiConst::zero;
$where['payment_time'] =Common::format(" payment_time > {0} and payment_time <={1}",$this->lastOrderId,TIMESTAMP);
$where=Common::format(" add_time > {0} and add_time <={1}",$this->lastOrderId,TIMESTAMP);
$res = $orderDao->getAllByWhere($where, $orderDao->getOrderDetailField());
$results = array();
if (!empty($res)) {
......@@ -417,7 +417,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$res = file_get_contents($this->baseDir . PathConst::favoritesStoreFavTimeConf);
$this->lastFavId = !empty($res) ? $res : ApiConst::zero;
$where['fav_time'] =Common::format("fav_time >={0} and fav_time <{1}",$this->lastFavId,TIMESTAMP);
$where =Common::format("fav_time >={0} and fav_time <{1}",$this->lastFavId,TIMESTAMP);
$res = $favoritesStoreDao->getAllByWhere($where, $favoritesStoreDao->favoriteMemberCountField);
$results = array();
if (!empty($res)) {
......@@ -468,12 +468,33 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
}while($storeMemberStatisticData);
file_put_contents($this->baseDir . PathConst::orderGoodsCreateTime, TIMESTAMP);
}
public function reduceRefundModel($storeMemberDatas){
$convertStoreMember=array();
if($storeMemberDatas){
foreach($storeMemberDatas as $order){
if(isset($convertStoreMember[$order['storeId']])){
$convertStoreMember[$order['storeId']]['orderCount']= $convertStoreMember[$order['storeId']]['orderCount']-ApiConst::one;
$convertStoreMember[$order['storeId']]['orderTotal']= $convertStoreMember[$order['storeId']]['orderTotal']+$order['refundAmount'];
}else{
$convertStoreMember[$order['storeId']]['orderCount']=ApiConst::one;
$convertStoreMember[$order['storeId']]['orderTotal']=$order['refundAmount'];
$convertStoreMember[$order['storeId']]['gmtCreate']=isset($order['gmtUpdate'])?date($order['gmtUpdate']):date('Y-m-d',TIMESTAMP);
}
}
$convertStoreMember=array_values($convertStoreMember);
$storeStatisticDayDao=\DAO\Store\StoreStatisticsDayModel::getInstance(DbNameConst::masterDBConnectName);
$storeStatisticDayDao->addAllReduce($convertStoreMember);
}
}
//任务脚本
public function reduceStoreMemberStatics()
{
$refundReturnDao=\DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
$storeMemberStatisticDao=\DAO\StoreMemberStatisticsModel::getInstance(DbNameConst::masterDBConnectName);
$gmtUpdate = file_get_contents($this->baseDir . PathConst::refundRetrunGmtUpdate);
$gmtUpdate = $gmtUpdate?$gmtUpdate:ApiConst::zero;
$this->taskIndex=PageConst::taskPageBegin;
......@@ -501,6 +522,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
}
$addDatas=array_values($addDatas);
$storeMemberStatisticDao->addAllReduce($addDatas);
$this->reduceRefundModel($storeMemberStatisticData);
}while($storeMemberStatisticData);
file_put_contents($this->baseDir . PathConst::refundRetrunGmtUpdate, TIMESTAMP);
......@@ -508,7 +530,6 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
//店铺订单统计任务脚本
public function storeStatictisTask()
{
$orderTotals = $this->getOrderTotal();
$memberTotals = $this->getMemberTotal();
$storeStatisticsDayDao = \DAO\Store\StoreStatisticsDayModel::getInstance(DbNameConst::masterDBConnectName);
......
......@@ -799,7 +799,7 @@ class StoreServiceModel extends \Business\AbstractModel{
//// $bundingGoodsDAO = \DAO\PBundlingGoodsModel::getInstance();
//// $goods = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingGoodsRedisModel::getInstance(),array(&$bundingGoodsDAO, 'getList'),array('bl_id,goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image AS goodsImage,bl_count_price AS goodsPrice,bl_goods_price AS discountPrice,num','bl_id in('.implode(',',$blIds).')'),\Our\ApiConst::oneDaySecond,array($storeId));
//// foreach ($goods as $v){
//// $v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage']);
//// $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
//// $bl_id = $v['bl_id'];
//// $v['goodsAttr'] = [];
//// unset($v['bl_id']);
......@@ -839,7 +839,7 @@ class StoreServiceModel extends \Business\AbstractModel{
if(is_array($list) && !empty($list)){
foreach ($list as $v){
unset($v['goods_price']);
$v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360);
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
$v['goodsPrice'] = (int)$v['goodsPrice'];
$goods[] = $v;
}
......
......@@ -78,7 +78,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>$goodsCommon['goods_commonid'],
'groupId'=>0,
'goodsName'=>$goodsCommon['goods_name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($goodsCommon['goods_image'],360),
'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($goodsCommon['goods_image'],360),
'goodsPrice'=>$goodsCommon['goods_price'],
'viewDate'=>$dates[$v]
];
......@@ -91,7 +91,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$acts,[],[],'',false),\Our\ApiConst::oneMinute);
if($list){
foreach ($list as $goodsCommon) {
$goodsCommon['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($goodsCommon['goodsImage'],360);
$goodsCommon['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goodsCommon['goodsImage'],360);
$goodsCommon['viewDate'] = $dates[$goodsCommon['goodsCommonId']];
$goodsCommon['groupId'] = 0;
$footPrints[] = $goodsCommon;
......@@ -111,7 +111,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>0,
'groupId'=>$group['blId'],
'goodsName'=>$group['name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($group['image'],360),
'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($group['image'],360),
'goodsPrice'=>$group['discountPrice'],
'viewDate'=>$dates[$group['blId']]
];
......
......@@ -232,7 +232,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel
// }
foreach ($list as $v){
//if($stores['store_id'] && $stores['store_id']['open_flag'] == 1 && $stores['store_id']['store_state'] == 1) {
$goods[] = array('favid'=>$v['favid'],'goodsCommonId'=>$v['goods_commonid'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_price'],'goodsId'=>$v['goods_id']);
$goods[] = array('favid'=>$v['favid'],'goodsCommonId'=>$v['goods_commonid'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_price'],'goodsId'=>$v['goods_id']);
// }
}
}
......
......@@ -335,8 +335,6 @@ class MemberModel extends \DAO\AbstractModel
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongMobileFormat);
}
$member = $this->getOneByWhereWithField(array('member_mobile' => $mobile), 'member_id');
\Our\Log::getInstance()->write($this->db->getLastSql());
\Our\Log::getInstance()->write(json_encode($member,true));
if ($member) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::registerMobileExist);
}
......
......@@ -710,6 +710,7 @@ class OrderModel extends \DAO\AbstractModel
$this->deleteFindByOrderIdCache($orderId);
$orderGoodsDao=\DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderGoodsDao->deleteOrderGoodsCache($memberId,$orderId);
\DAO\MemberModel::getInstance()->deleteTotalCache($memberId);
}
}
......@@ -835,6 +836,24 @@ class OrderModel extends \DAO\AbstractModel
}
return $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
}
public function updateCancelUnpayedOrderTimeCache($time){
\Redis\Db5\OrderRedisModel::getInstance()->tableCacheSet(\Our\NameConst::cancelUnPayedOrderTimePrefix,$time);
}
public function getCancelUnpayedOrderTimeCache(){
return \Redis\Db5\OrderRedisModel::getInstance()->tableCacheGet(\Our\NameConst::cancelUnPayedOrderTimePrefix);
}
public function updateCancelUnReceivedOrderTimeCache($time){
\Redis\Db5\OrderRedisModel::getInstance()->tableCacheSet(\Our\NameConst::cancelUnReceivedOrderTimePrefix,$time);
}
public function getCancelUnReceivedOrderTimeCache(){
return \Redis\Db5\OrderRedisModel::getInstance()->tableCacheGet(\Our\NameConst::cancelUnReceivedOrderTimePrefix);
}
/**
* 类实例
*
......
......@@ -113,6 +113,40 @@ class StoreStatisticsDayModel extends \DAO\AbstractModel {
}
}
//插入数据大量
public function addAllReduce($datas)
{
$this->setDb(DbNameConst::masterDBConnectName);
$error = 0;
$baseSql = "insert into {$this->_tableName}(store_id,order_count,order_total,gmt_create) values";
$extentSql=" ON DUPLICATE KEY UPDATE order_count=order_goods_count-values(order_goods_count),order_total=order_total-values(order_total)";
$insertAllSql = $baseSql;
for ($i = 0; $i < count($datas); $i++) {
$addSql = \Our\Common::format("({0},{1},{2},{3}),", $datas[$i]['storeId'], $datas[$i]['orderCount'], $datas[$i]['orderTotal'],datas[$i]['gmtCreate']);
$insertAllSql .= $addSql;
if ($i % 1000 == 0 && $i != 0) {
$insertAllSql = rtrim($insertAllSql, ',');
$insertSql=$insertAllSql.$extentSql;
$one = $this->db->insert($this->_tableName)->query($insertSql);
if (!$one) {
$error++;
}
$insertAllSql = $baseSql;
}
}
if ($insertAllSql != $baseSql) {
$insertAllSql = rtrim($insertAllSql, ',');
$insertSql=$insertAllSql.$extentSql;
$one = $this->db->insert($this->_tableName)->query($insertSql);
if (!$one) {
$error++;
}
}
if ($error > 0) {
$dataJson=json_encode($datas);
throw new Exception('插入han_store_member_statistics失败,'.$dataJson, 4);
}
}
//插入数据大量
public function addAll($datas)
{
$this->setDb(DbNameConst::masterDBConnectName);
......
......@@ -56,7 +56,7 @@ class StoreGoodsClassModel extends \DAO\AbstractModel {
$recommendGoods = array();
if($data){
foreach ($data as $v){
$goods = array('goodsCommonId'=>$v['goods_commonid'],'goodsName'=>$v['goods_name'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'goodsPrice'=>(int)$v['price'],'goodsMarketPrice'=>$v['goods_marketprice']);
$goods = array('goodsCommonId'=>$v['goods_commonid'],'goodsName'=>$v['goods_name'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'goodsPrice'=>(int)$v['price'],'goodsMarketPrice'=>$v['goods_marketprice']);
if(key_exists($v['stc_id'],$recommendGoods)){
if(count($recommendGoods[$v['stc_id']]['goods']) >= 8){
continue;
......
......@@ -19,8 +19,13 @@ $http->on('request', function ($request, $response) {
$info=$respData['content'];
$memberDao=$info['className']::getInstance(\Our\DbNameConst::masterDBConnectName);
echo json_encode($info['params']);
$res=call_user_func_array(array($memberDao,$info['method']),$info['params']);
$res=isset($res)?$res:true;
if(empty($info['params'])){
$res=call_user_func_array(array($memberDao,$info['method']));
}else{
$res=call_user_func_array(array($memberDao,$info['method']),$info['params']);
}
$res=(isset($res)&&!empty($res))?$res:false;
unset($memberDao);
if($res!==false){
echo 'success';
......
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