Commit a2810dab authored by wwccw0591's avatar wwccw0591

pc

parent 3ed800a0
......@@ -234,9 +234,9 @@ class OrderConfirmUtil {
$deliveryFee = $temp['shippingFee'];
}
// if($deliveryFee!=$requestData['deliveryFee']){
// \Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongStoreDeliveryFeeForOrder);
// }
if($deliveryFee!=$requestData['deliveryFee']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongStoreDeliveryFeeForOrder);
}
$delivery['deliveryFee'] = $deliveryFee;
$delivery['deliveryType'] = $requestData['deliveryType'];
$delivery['deliveryTime'] = isset($deliveryTime)?$deliveryTime:\Our\ApiConst::zero;
......@@ -253,9 +253,9 @@ class OrderConfirmUtil {
if($orderAmount<=\Our\ApiConst::zero){
$orderAmount = \Our\ApiConst::zero;
}
// if($orderAmount!=$requestData['totalFee']){
// \Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
// }
if($orderAmount!=$requestData['totalFee']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
}
$storeCartData['cartList'][$storeId]['orderAmount'] = $orderAmount;
}
return $storeCartData;
......
......@@ -22,6 +22,9 @@ class ApiConst
//一个小时
const oneHour = 3600;
//预警时间
const storageAlarmHour = 10800;
const twoMinSecond = 120;
const fiveMinutes=180;
......@@ -418,7 +421,9 @@ class ApiConst
//售后待收货
const messageRefundWaitReceive=105;
//用户被其它用户登录请退出
const messageOtherLogin=106;
const messageGoodsAlert=106;
//用户被其它用户登录请退出
const messageOtherLogin=107;
//消息按钮类型
const messageButtonTypeConfirmButton = 1;//确认收货
const messageButtonTypeReciverButton = 2;//确认接单
......
......@@ -174,6 +174,8 @@ class NameConst {
const add='add';
const reduce='reduce';
const set='set';
const logOut='logOut';
}
......
......@@ -3,6 +3,8 @@
namespace Business\Goods;
use Our\ApiConst;
use Our\Common;
use Zend\Json\Server\Exception\ErrorException;
class GoodsCommonServiceModel extends \Business\AbstractModel
......@@ -1286,4 +1288,15 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
return self::$_instance;
}
public function getAlertGoods(){
$goodsDao=\DAO\GoodsModel::getInstance();
$endTime=TIMESTAMP;
$beginTime=TIMESTAMP-ApiConst::storageAlarmHour;
$where=Common::format(" goods_edittime > {0} and goods_edittime<{1} and goods_storage<goods_storage_alarm",$beginTime,$endTime);
$stores=$goodsDao->getListGroup($where,"store_id as storeId,count(*) as count","store_id");
return $stores;
}
}
......@@ -73,6 +73,10 @@ class GoodsModel extends \DAO\AbstractModel {
$this->setDb();
return $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
}
public function getListGroup($where,$field,$groupField){
$this->setDb($this->dbName);
return $this->db->select($field)->from($this->_tableName)->where($where)->group($groupField)->fetchAll();
}
// public function getOneById($id){
// $this->setDb();
// return $this->db->select('goods_id,goods_commonid,goods_price,goods_marketprice,goods_image,goods_storage,goods_spec')->from($this->_tableName)->where(array('goods_id'=>$id))->fetchOne();
......
......@@ -84,6 +84,15 @@ class cliOrderClose extends basecli
$addData = unserialize($pushData);
$push->addOneToClient($addData);
}
$goodsCommonService=\Business\Goods\GoodsCommonServiceModel::getInstance();
$stores=$goodsCommonService->getAlertGoods();
if(!empty($stores)){
foreach($stores as $store){
$addData=array('storeId'=>$store['storeId'],'type'=>\Our\ApiConst::messageGoodsAlert,'op'=>\Our\NameConst::set,'num'=>$store['count'],'params'=>array());
$push->addOneToClient($addData);
}
}
$push->sendTcpMessage();
$redis->close();
}
......@@ -125,6 +134,7 @@ class cliOrderClose extends basecli
echo date('Y-m-d H:i:s',TIMESTAMP).'客户端消息推送成功'."\r\n";
}
}
......
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