Commit 1652d2c6 authored by wwccw0591's avatar wwccw0591

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

parents 14971c0d 46c57509
File mode changed from 100755 to 100644
......@@ -40,7 +40,7 @@ class GoodsController extends \Our\Controller_AbstractIndex {
}
public function testAction(){
//$info = $this->goodsService->recommend();
\DAO\GoodsCommonModel::getInstance()->getGrade(100030);
\Business\Goods\GoodsCommonServiceModel::getInstance()->saleGoods();
}
public function getAttrsAction(){
......
......@@ -152,6 +152,8 @@ class ApiConst
//是否退款成功
const refundSuccess = 1;
const refundFail = 0;
const refundCompleted=3;
//是否收到货
const shippingOver = 1;
const noShippingOver = 0;
......@@ -162,6 +164,8 @@ class ApiConst
//平台介入
const platIn = 1;
const platNotIn = 0;
//平台介入中
const platProccess=2;
//平台审核状态
const refundPlatformVerify = 0;
const refundPlatformAgree = 1;
......
......@@ -38,6 +38,7 @@ class PathConst {
const orderAddTime="/orderAddTime.conf";
const orderWaitRecieveTaskAddTime="/orderWaitRecieveTaskAddTime.conf";
const orderConfirmTaskAddTime="/orderConfirmTaskAddTime.conf";
const saleOrderGoodsAddTime="/saleOrderGoodsAddTime.conf";
const orderId="orderId={0}";
const authInfoOtherLogin="/authInfo/otherLogin";
......
......@@ -402,7 +402,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
//用户是否有参加这个活动
if($price = \DAO\SaleGoodsModel::getInstance()->getSalePrice($data,$activities)){
$v['goods_price'] = $price;
$commonInfo['goods_price'] = min($commonInfo['goods_price'],$price);
$commonInfo['goods_price'] = $price;
}
}
}
......@@ -824,10 +824,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
$storeId && $where['han_goods_attribute.store_id'] = $storeId;
$storeId || $where['source'] = 1; //来源:平台
$firstClassId && $where['firstClassId'] = $firstClassId;
$secondClassId && $where['secondClassId'] = $secondClassId;
$thirdClassId && $where['thirdClassId'] = $thirdClassId;
$storeThirdClassId && $where['storeThirdClassId'] = $storeThirdClassId;
$firstClassId && $where['gc_id_1'] = $firstClassId;
$secondClassId && $where['gc_id_2'] = $secondClassId;
$thirdClassId && $where['gc_id_3'] = $thirdClassId;
$storeThirdClassId && $where['goods_class_t_id'] = $storeThirdClassId;
$where['is_filter'] = 1;
$productData = [];
$attributeRedis = \Redis\Db4\GoodsAttributeRedisModel::getInstance();
......@@ -857,55 +857,60 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* 销售订单任务脚本
*/
public function saleGoods(){
for($i = 0; $i < 2000 ; $i++){
if($orderGoodsId = \DAO\SaleGoodsModel::getInstance()->popOrderGoodsList()){
$saleOrder = \DAO\SaleOrderModel::getInstance()->find(array('order_goods_id'=>$orderGoodsId),'id');
$baseConfDir = \Our\Common::getConfig('out.config');
$savePath = $baseConfDir . \Our\PathConst::saleOrderGoodsAddTime;
$addTime = file_get_contents($savePath);
$addTime = $addTime ? $addTime : \Our\ApiConst::zero;
$orderDao = \DAO\Order\OrderGoodsModel::getInstance(\Our\DbNameConst::masterDBConnectName);
$pageBegin = \Our\PageConst::taskPageBegin;
$time = TIMESTAMP;
do {
$orders = $orderDao->getSaleOrderGoods('rec_id,sale_act_id,sale_id,goods_id,goods_num,goods_name,goods_image,order_id,is_refund,goods_pay_price,refund_id', $addTime, $pageBegin, \Our\PageConst::taskPageSize);
foreach ($orders['list'] as $orderGoods) {
$saleOrder = \DAO\SaleOrderModel::getInstance()->find(array('order_goods_id'=>$orderGoods['rec_id']),'id');
$insert = [];
$update = [];
$orderGoods = \DAO\Order\OrderGoodsModel::getInstance()->find(array('rec_id'=>$orderGoodsId),'sale_act_id,sale_id,goods_id,goods_num,goods_name,goods_image,refund_id,order_id,refund_state_name');
$order = \DAO\Order\OrderModel::getInstance()->findByOrderId($orderGoods['order_id'],'buyer_id,order_state,evaluation_state');
$order = \DAO\Order\OrderModel::getInstance()->findByOrderId($orderGoods['order_id'],'order_state,order_sn,buyer_id');
if($saleOrder){
$update['refund_id'] = $orderGoods['refund_id'];
$update['refund_state_name'] = $orderGoods['refund_state_name'];
$update['is_refund'] = $orderGoods['is_refund'];
$update['order_state'] = $order['order_state'];
$update['evaluation_state'] = $order['evaluation_state'];
}else{
$member = \DAO\MemberModel::getInstance()->find($order['buyer_id']);
$insert['member_name'] = $member['member_name'];
$insert['member_avatar'] = $member['member_avatar'];
$insert['order_goods_id'] = $orderGoodsId;
$member = \DAO\MemberModel::getInstance()->getInfo($order['buyer_id']);
$insert['member_name'] = $member['memberName'];
$insert['member_avatar'] = $member['memberAvatarUrl'];
$insert['order_goods_id'] = $orderGoods['rec_id'];
$insert['sale_act_id'] = $orderGoods['sale_act_id'];
$insert['sale_id'] = $orderGoods['sale_id'];
$insert['goods_id'] = $orderGoods['goods_id'];
$insert['goods_num'] = $orderGoods['goods_num'];
$insert['goods_name'] = $orderGoods['goods_name'];
$insert['goods_image'] = $orderGoods['goods_image'];
$insert['refund_id'] = $orderGoods['refund_id'];
$insert['order_id'] = $orderGoods['order_id'];
$insert['refund_state_name'] = $orderGoods['refund_state_name'];
$insert['member_id'] = $order['buyer_id'];
$insert['order_state'] = $order['order_state'];
$insert['evaluation_state'] = $order['evaluation_state'];
$insert['is_refund'] = $orderGoods['is_refund'];
$insert['order_sn'] = $order['order_sn'];
$insert['goods_pay_price'] = $orderGoods['goods_pay_price'];
}
if($orderGoods['refund_id'] > 0 ){
$refund = \DAO\Order\RefundReturnModel::getInstance()->find(array('refund_id'=>$orderGoods['refund_id']),'seller_state,is_platform_in,platform_state');
if($saleOrder){
$update['seller_state'] = $refund['seller_state'];
$update['is_platform_in'] = $refund['is_platform_in'];
$update['platform_state'] = $refund['platform_state'];
}else{
$insert['seller_state'] = $refund['seller_state'];
$insert['is_platform_in'] = $refund['is_platform_in'];
$insert['platform_state'] = $refund['platform_state'];
}
}
if($saleOrder){
\DAO\SaleOrderModel::getInstance()->update(array('order_goods_id'=>$orderGoodsId),$update);
\DAO\SaleOrderModel::getInstance(\Our\DbNameConst::masterDBConnectName)->update(array('order_goods_id'=>$orderGoods['rec_id']),$update);
}else{
\DAO\SaleOrderModel::getInstance()->insert($insert);
}
\DAO\SaleOrderModel::getInstance(\Our\DbNameConst::masterDBConnectName)->insert($insert);
}
$saleOrderDAO = \DAO\SaleOrderModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(), array(&$saleOrderDAO, 'getOrderGoodsList'),array(),array($order['buyer_id']));
}
$pageBegin++;
} while (!empty($orders['list']));
file_put_contents($savePath, $time);
}
/**
......@@ -1009,57 +1014,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
//$commonIds = array_merge($arr,$commonIds);
// $weekSales = $goodsCommonRedis->tableSmembers('weekSales:'.$storeId);
// if($weekSales) {
// $arr = array_merge(array_diff($weekSales, $existIds));
// if($arr) {
// shuffle($arr);
// $ret = array_pop($arr);
// if($ret) {
// $commonIds[] = $ret;
// $existIds[] = $ret;
// }
// }
// }
//
//
// $weekSaleGoods = $goodsCommonRedis->tableSmembers('weekSaleGoods:'.$storeId);
// if($weekSaleGoods) {
// $arr = array_merge(array_diff($weekSaleGoods, $existIds));
// if($arr) {
// shuffle($arr);
// $ret = array_pop($arr);
// if($ret) {
// $commonIds[] = $ret;
// $existIds[] = $ret;
// }
// $ret = array_pop($arr);
// if($ret) {
// $commonIds[] = $ret;
// $existIds[] = $ret;
// }
// }
// }
// $recommendGoods = $goodsCommonRedis->tableSmembers('recommendGoods:'.$storeId);
// if($recommendGoods) {
// $arr = array_merge(array_diff($recommendGoods, $existIds));
// if($arr) {
// shuffle($arr);
// while(true) {
// $ret = array_pop($arr);
// if($ret) {
// $commonIds[] = $ret;
// $existIds[] = $ret;
// }else{
// break;
// }
// if(count($commonIds) == 4){
// break;
// }
// }
// }
// }
$goods = [];
if($commonIds){
//该用户是否有参加销售活动
......
......@@ -45,6 +45,7 @@ class StoreServiceModel extends \Business\AbstractModel{
$sale = \DAO\SaleModel::getInstance()->getOne(array('sale_id'=>$param['sid']),'sale_act_id,member_id');
if($sale) {
\DAO\SaleMemberModel::getInstance()->insertOrUpdate(array('sale_id'=>$sale['member_id'],'sale_act_id'=>$sale['sale_act_id'],'member_id'=>$memberId,'store_id'=>$storeId));
\Redis\Db4\SaleActivityRedisModel::getInstance()->tableDel('storeId:'.$storeId);
}
}
}else{
......@@ -175,22 +176,23 @@ class StoreServiceModel extends \Business\AbstractModel{
return array('storeName'=>$storeInfo['store_name'],'storeLabel'=>$storeLabel,'fansCount'=>\DAO\FavoritesStoreModel::getInstance()->getFavoritesStoreCountByStoreId($storeId),'clazz'=>$returnClass,'address'=>$address,'storePhone'=>$storeInfo['store_phone'],'openingHours'=>$openingHours,'storeService'=>$storeInfo['store_notice'],"qualificationImage"=>$detailImg);
}
public function getRecommendGoodsCache($param,$memberId){
$recommendGoods = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreGoodsClassRedisModel::getInstance(),array(&$this, 'getRecommendGoods'),array($param,$memberId),\Our\ApiConst::oneDaySecond,array(intval($param['storeId'])));
return $recommendGoods;
}
/**
* 获取店铺首页推荐商品
* @param $param
*/
public function getRecommendGoods($param,$memberId){
$storeId = intval($param['storeId']);
if(!$storeId){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyStoreId);
}
\DAO\StoreModel::getInstance()->get($storeId,false);
$activities = \DAO\SaleMemberModel::getInstance()->isJoinStore($storeId,$memberId);
if($activities) {
$activities = array_keys($activities);
}
$recommendGoods = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreGoodsClassRedisModel::getInstance(),array(&$this, 'getRecommendGoods'),array($storeId,$activities),\Our\ApiConst::oneDaySecond,array(intval($param['storeId'])));
return $recommendGoods;
}
/**
* 获取店铺首页推荐商品
* @param $param
*/
public function getRecommendGoods($storeId,$activities){
$storeClassDAO = \DAO\StoreGoodsClassModel::getInstance();
$tempStcs = $storeClassDAO->getList(array('store_id'=>$storeId),'stc_id,stc_name');
if($tempStcs) {
......@@ -202,11 +204,11 @@ class StoreServiceModel extends \Business\AbstractModel{
$goodsIds = array_column($stcGoods,'goods_common_id');
$goodsCommonDAO = \DAO\GoodsCommonModel::getInstance();
if($activities === false){
$tempGoods = $goodsCommonDAO->getGoodsList(array('goods_commonid in('.implode(',',$goodsIds).')'),'goods_name,goods_image,goods_price,goods_marketprice,goods_commonid');
$tempGoods = $goodsCommonDAO->getGoodsList(array('goods_commonid in('.implode(',',$goodsIds).')'),'goods_name,goods_image,goods_price as goodsPrice,goods_marketprice,goods_commonid');
}else{
$activities = array_keys($activities);
$tempGoods = $goodsCommonDAO->getListWithSale(array('han_goods_common.goods_commonid in('.implode(',',$goodsIds).')'),'goods_name,goods_image,goods_price,goods_marketprice,han_goods_common.goods_commonid',$activities);
$tempGoods = $goodsCommonDAO->getListWithSale(array('han_goods_common.goods_commonid in('.implode(',',$goodsIds).')'),'goods_name,goods_image,goods_price,goods_marketprice,han_goods_common.goods_commonid,IFNULL(discount_price,han_goods_common.goods_price) AS goodsPrice',$activities);
}
if($tempGoods && $tempStcs){
$stcs = [];
foreach ($tempStcs as $v){
......@@ -222,7 +224,7 @@ class StoreServiceModel extends \Business\AbstractModel{
'goodsCommonId'=>$v['goods_common_id'],
'goodsName'=>$goods[$v['goods_common_id']]['goods_name'],
'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($goods[$v['goods_common_id']]['goods_image']),
'goodsPrice'=>$goods[$v['goods_common_id']]['goods_price'],
'goodsPrice'=>$goods[$v['goods_common_id']]['goodsPrice'],
'goodsMarketPrice'=>$goods[$v['goods_common_id']]['goods_marketprice'],
];
if(key_exists($v['stc_id'],$recommendGoods)){
......
......@@ -78,7 +78,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
$memberName = $member['memberName'];
$memberAvatarUrl = $member['memberAvatarUrl'];
$orderGoodsList = \Our\RedisHelper::cachedFunction(\Redis\Db1\SaleOrderRedisModel::getInstance(),array(&$saleOrderDAO, 'getOrderGoodsList'),array("sale_act_id in(".implode(',',$saleActArr).") AND sale_id = {$memberId} AND goods_id in(".implode(',',$goodsIds).")",'sum(goods_num) AS goodsCount,goods_name AS goodsName,goods_image AS goodsImage,goods_id AS goodsId,sale_act_id','goods_id',[],'sale_act_id'),\Our\ApiConst::tenMinSecond,array($memberId));
$orderGoodsList = \Our\RedisHelper::cachedFunction(\Redis\Db1\SaleOrderRedisModel::getInstance(),array(&$saleOrderDAO, 'getOrderGoodsList'),array("sale_act_id in(".implode(',',$saleActArr).") AND sale_id = {$memberId} AND goods_id in(".implode(',',$goodsIds).")",'sum(goods_num) AS goodsCount,goods_name AS goodsName,goods_image AS goodsImage,goods_id AS goodsId,sale_act_id','goods_id',[],'sale_act_id'),\Our\ApiConst::halfDaySecond,array($memberId));
$existIds = [];
if($orderGoodsList && is_array($orderGoodsList)) {
foreach ($orderGoodsList as $v){
......@@ -180,11 +180,13 @@ class SalespersonServiceModel extends \Business\AbstractModel
$saleOrderDAO = \DAO\SaleOrderModel::getInstance();
$where = "sale_act_id = {$actId} AND sale_id = {$memberId} AND goods_id = {$goodsId}";
if($type === 0) {
$where .= " AND (order_state=%s AND (refund_id = %s OR (refund_id > %s AND ((seller_state = %s AND is_platform_in = %s) OR (is_platform_in = %s AND platform_state = %s)))))";
$where = sprintf($where,ApiConst::orderStateComplete,ApiConst::zero,ApiConst::zero,ApiConst::refundSellerRefuse,ApiConst::platNotIn,ApiConst::platIn,ApiConst::refundPlatformRefuse);
// $where .= " AND (order_state=%s AND (refund_id = %s OR (refund_id > %s AND ((seller_state = %s AND is_platform_in = %s) OR (is_platform_in = %s AND platform_state = %s)))))";
$where .= " AND order_state=40 AND is_refund=0";
// $where = sprintf($where,ApiConst::orderStateComplete,ApiConst::zero,ApiConst::zero,ApiConst::refundSellerRefuse,ApiConst::platNotIn,ApiConst::platIn,ApiConst::refundPlatformRefuse);
}else{
$where .=" AND (order_state < %s OR (order_state = %s AND refund_id > %s AND (seller_state != %s OR (is_platform_in = %s AND platform_state != %s ))))";
$where = sprintf($where,ApiConst::orderStateComplete,ApiConst::orderStateComplete,ApiConst::zero,ApiConst::refundSellerRefuse,ApiConst::platIn,ApiConst::refundPlatformRefuse);
// $where .=" AND (order_state < %s OR (order_state = %s AND refund_id > %s AND (seller_state != %s OR (is_platform_in = %s AND platform_state != %s ))))";
$where .= " AND order_state < 40 OR (order_state = 40 AND is_refund = 1)";
// $where = sprintf($where,ApiConst::orderStateComplete,ApiConst::orderStateComplete,ApiConst::zero,ApiConst::refundSellerRefuse,ApiConst::platIn,ApiConst::refundPlatformRefuse);
}
$goodsList = $saleOrderDAO->getOrderGoodsList($where,'member_id,member_name AS memberName,member_avatar AS memberAvatar,sum(goods_num) AS goodsNum','member_id',$limit);
$orders = [];
......@@ -198,7 +200,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
// }
$orders[] = [
'memberName'=>$v['memberName'],
'memberAvatar'=>\DAO\MemberModel::getInstance()->getMemberAvatarUrl($v['member_id'],$v['memberAvatar']),
'memberAvatar'=>$v['memberAvatar'],
'goodsNum'=>$v['goodsNum']
];
}
......
......@@ -190,7 +190,8 @@ class AddressModel extends \DAO\AbstractModel {
}
public function checkSessAddress($tempAddress,$sessAddress){
if($tempAddress['lat']==$sessAddress['lat']&&$tempAddress['lng']==$sessAddress['lng']&&$tempAddress['cityCode']==$sessAddress['cityCode']&&(isset($sessAddress['chooseFlag'])&&$sessAddress['chooseFlag'])){
$distance = \Our\CommonExtension::getDistance($tempAddress['lat'],$tempAddress['lng'],$sessAddress['lat'],$sessAddress['lng']);
if($distance<=\Our\ApiConst::minDistanceForCurrentPosition&&(isset($sessAddress['chooseFlag'])&&$sessAddress['chooseFlag'])){
return true;
}
return false;
......
......@@ -220,6 +220,7 @@ class OrderModel extends \DAO\AbstractModel
public function update($where, $data)
{
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$data['gmt_update']=TIMESTAMP;
return $this->db->update($this->_tableName)->where($where)->rows($data)->execute();
}
......@@ -803,14 +804,13 @@ class OrderModel extends \DAO\AbstractModel
}
//删除订单缓存
public function deleteOrderCache($memberId, $orderId = false, $stroeId = false, $deleteGetShopKeeperCountByStoreId = false, $deleteGetFavoritesCountByStoreId = false,$diliverymanId=0)
public function deleteOrderCache($memberId, $orderId = false, $stroeId = false, $deleteGetShopKeeperCountByStoreId = false, $deleteGetFavoritesCountByStoreId = false,$diliverymanId=ApiConst::zero)
{
if (!empty($memberId)) {
$this->deleteGetListByMemberId($memberId);
\DAO\MemberModel::getInstance()->deleteTotalCache($memberId);
}
if (!empty($stroeId)) {
if ($deleteGetShopKeeperCountByStoreId) {
$this->deleteGetShopKeeperCountByStoreId($stroeId);
......@@ -901,11 +901,12 @@ class OrderModel extends \DAO\AbstractModel
$limit = TIMESTAMP - $timeLimit;
$where[$timeField] = array('lt', $limit);
$where = $this->db->getSqlWhereByArray($where);
return $this->db->update($this->_tableName)->where($where)->rows(array('order_state' => $toState))->execute();
return $this->db->update($this->_tableName)->where($where)->rows(array('order_state' => $toState,'gmt_update'=>$toState))->execute();
}
/**
* 获取订单列表
* @param $where
......
......@@ -186,8 +186,13 @@ class OrderGoodsModel extends \DAO\AbstractModel {
'goodsPayPrice'=>$orderGoods['goodsPayPrice'],
);
}
//销售订单
public function getSaleOrderGoods($field,$updateTime,$pageIndex,$pageSize) {
$this->setDb($this->dbName);
$where = Common::format('sale_act_id >0 AND gmt_update >= {0}', $updateTime);
$list = $this->lists($where, '', $field, $pageIndex, $pageSize);
return $list;
}
public function insertAll($datas){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
......
......@@ -100,6 +100,7 @@ class RefundReturnModel extends \DAO\AbstractModel {
$where['refund_id'] = $refundId;
$where['buyer_id'] = $buyerId;
$data['is_platform_in']=ApiConst::platIn;
$data['refund_state']=ApiConst::platProccess;
$data['platform_in_reason']=$applyMessage;
return $this->update($where, $data);
}
......@@ -137,6 +138,7 @@ class RefundReturnModel extends \DAO\AbstractModel {
}
public function getStatusExtent($returnRefund){
if($returnRefund['refundState']!=ApiConst::refundCompleted){
if($returnRefund['sellerState']==ApiConst::refundSellerAgree){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::refoundSuccess;
......@@ -166,6 +168,11 @@ class RefundReturnModel extends \DAO\AbstractModel {
return OrderConst::sellerRefuseGoods;
}
}
}else{
return OrderConst::refoundSuccess;
}
}
public function getRefundTextStatus($refundReturn){
$refundText='';
......@@ -173,6 +180,9 @@ class RefundReturnModel extends \DAO\AbstractModel {
case ApiConst::refundSellerVerify:$refundText=OrderConst::waitVerify;break;
case ApiConst::refundSellerAgree:$refundText=$this->getStatusExtent($refundReturn);break;
case ApiConst::refundSellerRefuse:$refundText=$this->getStatusExtent($refundReturn);break;
}
if($refundReturn['']){
}
return $refundText;
}
......
......@@ -36,26 +36,26 @@ class SaleOrderModel extends \DAO\AbstractModel {
return $this->db->insert($this->_tableName)->query($sql);
}
public function insert($data){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$this->setDb($this->dbName);
return $this->db->insert($this->_tableName)->rows($data)->execute();
}
public function update($where,$data){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
return $this->db->update($this->_tableName)->rows($data)->where($where)->execute();
$this->setDb($this->dbName);
return $this->db->update($this->_tableName)->where($where)->rows($data)->execute();
}
public function getOrderGoodsList($where,$field,$group = null,$limit = [],$group2 = null){
$this->setDb();
$this->setDb($this->dbName);
if($limit){
return $this->db->from($this->_tableName)->select($field)->where($where)->group($group)->group($group2)->limit($limit[0],$limit[1])->fetchAll();
}
return $this->db->from($this->_tableName)->select($field)->where($where)->group($group)->group($group2)->fetchAll();
}
public function getCount($where){
$this->setDb();
$this->setDb($this->dbName);
return $this->db->from($this->_tableName)->where($where)->fetchNum();
}
public function getCountGroup($where, $group) {
$this->setDb();
$this->setDb($this->dbName);
$sql = "SELECT COUNT(*) AS count from (SELECT id FROM {$this->_tableName} where {$where} GROUP BY {$group}) a";
$row = $this->db->query($sql);
if($row) {
......
......@@ -280,6 +280,7 @@ class StoreModel extends \DAO\AbstractModel
}
return $storeInfo;
}
/**
* 店铺分享图片
*
......
......@@ -271,7 +271,10 @@ class CodeConfigModel {
const notExsitOrder=300112;
const alreadyExsitRefundGoods=300113;
const notAllowDelete=300114;
const platFormAreadyIn=300115;
const noExpressDeliveryForOrder1 = 30115;
const goodsNoStoreForCartOrOrder1 = 30116;
const platFormAreadyIn=300117;
//店铺相关错误码
//商品分类
......@@ -736,6 +739,8 @@ class CodeConfigModel {
self::blGoodsStorageToCacheFailedForOrder => '组合销售库存更新失败(cache)',
self::goodsStorageToCacheFailedForOrder => '普通商品库存更新失败(cache)',
self::notExistOrderGoods => '退款商品不存在',
self::noExpressDeliveryForOrder1 => '该店铺未配置快递配送',
self::goodsNoStoreForCartOrOrder1 => '商品库存紧张,您的购买数量太多啦',
//销售员
self::emptySaleGoodsId=>'商品id不能为空',
self::emptySaleGoods=>'销售商品不存在',
......
......@@ -19,6 +19,9 @@ class SaleActivityRedisModel extends \Redis\Db4\AbstractModel {
$res=$this->set($this->calcKey($id), $data,$experio);
return $res;
}
public function tableDel($h){
return $this->del($this->calcKey($h));
}
public function getList(){
}
......
[common]
; 通用配置
http://domain/Api/Member/index
; 支持PHP中的已定义常量, Windows 平台需要注意目录分割符的问题
application.directory = APPLICATION_PATH "/application/"
; 是否使用默认的异常捕获Controller
application.dispatcher.catchException = true
; 配置多模块
; Index默认的模块
; Api模块用于手机应用的数据接口
; Admin模块用于后台管理
application.modules = Index,Api,Admin
//生产环境
[product : 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 = "qmcs"
resources.database.params.password = "qmcs$#$%%^&^&^"
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 = "qmcs"
resources.database.slave.params.password = "qmcs$#$%%^&^&^"
resources.database.slave.params.charset = "UTF8"
resources.database.slave.params.driver_options.1002 = "SET NAMES utf8"
; redis配置
out.config="/data/config"
;redis.database.params.password = "test"
;推送配置
push.clientHost="wss://apiceshi.shenbd.com/wss"
push.host="127.0.0.1"
push.port="9503"
push.open=1
; 生 产环境配置
[pre : 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 = "!@#$%12345werty"
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 = "!@#$%12345werty"
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="wss://apiceshi.shenbd.com/wss"
push.host="127.0.0.1"
push.port="9503"
push.open=1
elastic.master.host="127.0.0.1"
elastic.master.port="9200"
elastic.master.scheme="http";
;pre环境配置
[test : 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 = "!@#$%12345werty"
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 = "!@#$%12345werty"
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="127.0.0.1"
push.port="9503"
push.open=1
[develop : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "192.168.1.201"
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 = "192.168.1.201"
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"
push.clientHost="ws://192.168.80.18:9502"
redis.database.params.host = "127.0.0.1"
redis.database.params.port = "6379"
redis.database.params.prefix = "qm_"
out.config="/data/config"
; 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
[ccwdevelop : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "192.168.1.201"
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 = "192.168.1.201"
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
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"
[common]
[product : common]
[develop : product]
[common]
; 通用配置
[product : common]
; 生产环境配置
; url相关配置
; 开发环境配置
; 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";
[pre : common]
; 测试环境配置
; url相关配置
; 开发环境配置
config.url.convert=/usr/local/bin/wkhtmltoimage
; url相关配置
config.url.resourcesHost = "http://apitest.shenbd.com"
; 用户中心host
config.url.userHost = ""
; oss 域名
config.url.ossHost = "https://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.indexUrl="/www/web/apitest_shenbd_com/public_html/application/library/React"
config.url.libary="/www/web/apitest_shenbd_com/public_html/application/library"
[test : common]
; 测试环境配置
; url相关配置
; 开发环境配置
; url相关配置
config.url.resourcesHost = "http://apitest.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";
[develop : common]
; 开发环境配置
; url相关配置
config.url.resourcesHost = "http://test.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.storePath = '/data/upload/mall/store';
;店铺商品图片保存目录
;config.url.storeGoodsPath = '/data/upload/mall/store/goods';
;默认图片文件
;config.url.defaultGoodsImage = '/data/upload/mall/common/default_goods_image.gif';
;默认店铺logo文件
;config.url.defaultStoreImage = '/data/upload/mall/common/default_store_avatar.png';
;默认用户头像文件
;config.url.defaultUserImage = '/data/upload/mall/common/default_user_portrait.gif';
[ccwdevelop : 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"
; 文件目录
......@@ -2,7 +2,7 @@
/**
* 销售订单商品表写入
* 执行时间:每隔5分钟执行一次
* 执行时间:每隔2分钟执行一次
*/
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../../')); //指向public的上一级
......@@ -59,9 +59,9 @@ class cliSaleOrder extends basecli
if( file_exists( $this->lockFileName ) )
{
$stat = stat($this->lockFileName);
if( (TIMESTAMP - $stat['mtime']) > 1800 )
if( (TIMESTAMP - $stat['mtime']) > 1200 )
{
echo "文件被锁超过1800秒,被强制删除";
echo "文件被锁超过1200秒,被强制删除";
@unlink($this->lockFileName);
}
else
......
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