Commit f4bcd92f authored by zhz's avatar zhz

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

parents 6c38eeca 9fac3fc6
...@@ -38,8 +38,36 @@ class IndexController extends \Our\Controller_Abstract { ...@@ -38,8 +38,36 @@ class IndexController extends \Our\Controller_Abstract {
$this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance(); $this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
$paramsStr= $this->memberDb0Redis->tablelpop($this->key); $paramsStr= $this->memberDb0Redis->tablelpop($this->key);
// $paramsStr='{
// "desc": "最优质的产品,最实惠的价格,最好的服务质量,欢迎选购",
//"deviceWidth": "828",
//"id": "1050000",
//"imgUrl": "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com/mall/store/05960231407828374.jpg?x-oss-process=image/resize,m_fill,h_186,w_186",
//"key": "bda203557fcc08150fc997360d432bfa",
//"shareType": "1",
//"storeName": "LQ日化用品",
//"timestamp": "1543913056",
//"type": "2",
//"driverType": 2,
//"qrCode": "http://share.shenbd.com/share.html?type=store&id=1050000",
//"address": "鑫雄盛快捷酒店仓山紫番林幼儿园",
//"storeWorkingtime": "",
//"buyerDistribution": 1,
//"sellerDistribution": 1,
//"startShippingPrice": 2000,
//"freeShippingPrice": 0,
//"storeStartTime": "09:00",
//"storeCloseTime": "23:00"
//}';
$paramsStr=json_decode($paramsStr,true); $paramsStr=json_decode($paramsStr,true);
if($paramsStr['type']==\Our\ApiConst::shareStore || $paramsStr['type']==\Our\ApiConst::shareSaler){
$begin=strtotime($paramsStr['storeStartTime']);
$end=strtotime($paramsStr['storeCloseTime']);
if($begin>=$end){
$paramsStr['storeCloseTime']=\Our\DescribeConst::storeCloseTimePre.date('H:i',$end+\Our\ApiConst::oneDaySecond);
}
}
$this->_view->assign("params", $paramsStr); $this->_view->assign("params", $paramsStr);
if($paramsStr['type']==\Our\ApiConst::sharePlat){ if($paramsStr['type']==\Our\ApiConst::sharePlat){
$this->_view->display('index/plat.phtml'); $this->_view->display('index/plat.phtml');
...@@ -48,6 +76,7 @@ class IndexController extends \Our\Controller_Abstract { ...@@ -48,6 +76,7 @@ class IndexController extends \Our\Controller_Abstract {
$this->_view->display('index/store.phtml'); $this->_view->display('index/store.phtml');
} }
if($paramsStr['type']==\Our\ApiConst::shareGoods || $paramsStr['type']==\Our\ApiConst::shareGroup){ if($paramsStr['type']==\Our\ApiConst::shareGoods || $paramsStr['type']==\Our\ApiConst::shareGroup){
$this->_view->display('index/goods.phtml'); $this->_view->display('index/goods.phtml');
} }
if($paramsStr['type']==\Our\ApiConst::shareSaler){ if($paramsStr['type']==\Our\ApiConst::shareSaler){
......
...@@ -240,8 +240,13 @@ class ApiConst ...@@ -240,8 +240,13 @@ class ApiConst
const bySelf = 0; const bySelf = 0;
const bySeller = 1; const bySeller = 1;
const express = 2; const express = 2;
//待自提 //待自提
const oneHandred=100; const oneHandred=100;
const cancelOrderAuto=1;
const closeOrder=2;
const cancelOrderBySelf=4;
//待配送 //待配送
const oneHandredOne=101; const oneHandredOne=101;
......
...@@ -66,6 +66,8 @@ class DescribeConst ...@@ -66,6 +66,8 @@ class DescribeConst
const receiveCouponSuccess = '领取优惠券成功'; const receiveCouponSuccess = '领取优惠券成功';
const addCartSuccess = '加入购物车成功'; const addCartSuccess = '加入购物车成功';
const storeCloseTimePre='次日';
const setMessageSuccess='消息设置成功'; const setMessageSuccess='消息设置成功';
const editCartSuccess = '编辑购物车成功'; const editCartSuccess = '编辑购物车成功';
......
...@@ -155,6 +155,8 @@ class NameConst { ...@@ -155,6 +155,8 @@ class NameConst {
const goodsCollection = 'goodsCollection';//商品收藏数量 const goodsCollection = 'goodsCollection';//商品收藏数量
const footprint = 'footprint';//足迹数量 const footprint = 'footprint';//足迹数量
const clientUpdateUrl='shenbd.zip';
const leftBracket = '['; const leftBracket = '[';
const rightBracket = ']'; const rightBracket = ']';
const elasticName='elastic.master'; const elasticName='elastic.master';
......
...@@ -27,7 +27,7 @@ class Alipay { ...@@ -27,7 +27,7 @@ class Alipay {
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
$request = new \Alipay\aop\request\AlipayTradeAppPayRequest(); $request = new \Alipay\aop\request\AlipayTradeAppPayRequest();
//SDK已经封装掉了公共参数,这里只需要传入业务参数 //SDK已经封装掉了公共参数,这里只需要传入业务参数
$bizcontent = "{\"body\":\"订单号".implode(',',$order['orderSns'])."\"," $bizcontent = "{\"body\":\"".$order['storeName']."的订单\","
. "\"subject\": \"r|".$order['paySn']."\"," . "\"subject\": \"r|".$order['paySn']."\","
. "\"out_trade_no\": \"".$order['paySn']."\"," . "\"out_trade_no\": \"".$order['paySn']."\","
. "\"timeout_express\": \"30m\"," . "\"timeout_express\": \"30m\","
......
...@@ -14,7 +14,7 @@ class Pay { ...@@ -14,7 +14,7 @@ class Pay {
private $order; private $order;
private $paySn; private $paySn;
private $member; private $member;
private $orderField = 'order_amount,order_sn,store_id'; private $orderField = 'order_amount,order_sn,store_id,store_name';
private $requestData ; private $requestData ;
private $orderAmount= \Our\ApiConst::zero; private $orderAmount= \Our\ApiConst::zero;
...@@ -92,6 +92,7 @@ class Pay { ...@@ -92,6 +92,7 @@ class Pay {
} }
$orderInfo['paySn'] = $this->paySn; $orderInfo['paySn'] = $this->paySn;
$orderInfo['orderSns'] = array_column($orderList,'order_sn'); $orderInfo['orderSns'] = array_column($orderList,'order_sn');
$orderInfo['storeName'] = $orderList[0]['store_name'];
return $orderInfo; return $orderInfo;
} }
......
...@@ -33,7 +33,8 @@ class TencentPay { ...@@ -33,7 +33,8 @@ class TencentPay {
$this->parameters['appid']=$this->appid; $this->parameters['appid']=$this->appid;
$this->parameters['mch_id']=$this->mch_id; $this->parameters['mch_id']=$this->mch_id;
$this->parameters['nonce_str']=\Our\CommonExtension::createNoncestr(32); $this->parameters['nonce_str']=\Our\CommonExtension::createNoncestr(32);
$this->parameters['body']='订单号:'.implode(',',$orderInfo['orderSns']); //$this->parameters['body']='订单号:'.implode(',',$orderInfo['orderSns']);
$this->parameters['body']=$orderInfo['storeName'].'的订单';
$this->parameters['attach']='r|'.$pay_sn; $this->parameters['attach']='r|'.$pay_sn;
$this->parameters['out_trade_no']=$pay_sn; $this->parameters['out_trade_no']=$pay_sn;
$this->parameters['fee_type']= \Our\NameConst::currentCNY; $this->parameters['fee_type']= \Our\NameConst::currentCNY;
...@@ -63,7 +64,8 @@ class TencentPay { ...@@ -63,7 +64,8 @@ class TencentPay {
$this->parameters['sub_appid']=$this->appid; $this->parameters['sub_appid']=$this->appid;
$this->parameters['sub_mch_id']=$orderInfo['subMchId']; $this->parameters['sub_mch_id']=$orderInfo['subMchId'];
$this->parameters['nonce_str']=\Our\CommonExtension::createNoncestr(32); $this->parameters['nonce_str']=\Our\CommonExtension::createNoncestr(32);
$this->parameters['body']='订单号:'.implode(',',$orderInfo['orderSns']); //$this->parameters['body']='订单号:'.implode(',',$orderInfo['orderSns']);
$this->parameters['body']=$orderInfo['storeName'].'的订单';
$this->parameters['attach']='r|'.$pay_sn; $this->parameters['attach']='r|'.$pay_sn;
$this->parameters['out_trade_no']=$pay_sn; $this->parameters['out_trade_no']=$pay_sn;
$this->parameters['fee_type']= \Our\NameConst::currentCNY; $this->parameters['fee_type']= \Our\NameConst::currentCNY;
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
namespace Business\Common; namespace Business\Common;
use Our\Common;
use Our\NameConst;
class SettingServiceModel extends \Business\AbstractModel{ class SettingServiceModel extends \Business\AbstractModel{
public function getCurrentVersion($param){ public function getCurrentVersion($param){
...@@ -22,7 +25,11 @@ class SettingServiceModel extends \Business\AbstractModel{ ...@@ -22,7 +25,11 @@ class SettingServiceModel extends \Business\AbstractModel{
public function getAppVersion(){ public function getAppVersion(){
$settingDAO = \DAO\SettingModel::getInstance(); $settingDAO = \DAO\SettingModel::getInstance();
$version = $settingDAO->getListCache(array('app_version')); $version = $settingDAO->getListCache(array('app_version'));
return array('version'=>$version['app_version']);
$updateUrl=\Bootstrap::getUrlIniConfig('ossHost');
$fileName='/'.NameConst::refund;
$updateUrl=$updateUrl.'/'.$fileName;
return array('version'=>$version['app_version'],'updateUrl'=>$updateUrl);
} }
public function getServicePhone(){ public function getServicePhone(){
......
...@@ -27,6 +27,30 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -27,6 +27,30 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* @throws \Exception * @throws \Exception
*/ */
public function setGoodsStorage($storeId, $goodsId, $num = 0, $type='add') { public function setGoodsStorage($storeId, $goodsId, $num = 0, $type='add') {
$orderService=\Business\Order\OrderServiceModel::getInstance();
if($goodsId === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
}
if($type=='add'){
$type=ApiConst::plus;
}else{
$type=ApiConst::set;
}
$res=$orderService->updateGoodsStoregeByGoodsIds($storeId,$goodsId,$num,$type);
return $res;
}
/**
* 设置库存
* @param $storeId
* @param $goodsId
* @param int $num
* @param string $type
* @return array
* @throws \Exception
*/
public function setGoodsStorageBak($storeId, $goodsId, $num = 0, $type='add') {
if($goodsId === 0){ if($goodsId === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError); \Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
} }
......
...@@ -332,8 +332,9 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -332,8 +332,9 @@ class OrderServiceModel extends \Business\AbstractModel
$isAllowCancel = $orderDao->isAllowCancel($order); $isAllowCancel = $orderDao->isAllowCancel($order);
$isAllowCance = true; $isAllowCance = true;
if ($isAllowCancel) { if ($isAllowCancel) {
$res = $orderDao->updateStatusByOrderId($orderId, ApiConst::orderStateCancel); $res = $orderDao->updateStatusByOrderId($orderId, ApiConst::orderStateCancel,false,ApiConst::cancelOrderBySelf);
if ($res) { if ($res) {
$this->updateOrderGoodsStoregeByOrderIds(array($orderId));
$order['refundOrderNo']=$refundReturnDao->getRefundsn($order['storeId']); $order['refundOrderNo']=$refundReturnDao->getRefundsn($order['storeId']);
if($order['paymentTime']>ApiConst::zero){ if($order['paymentTime']>ApiConst::zero){
$resultRefund=$refundReturnDao->refundMoney($order); $resultRefund=$refundReturnDao->refundMoney($order);
...@@ -664,7 +665,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -664,7 +665,7 @@ class OrderServiceModel extends \Business\AbstractModel
foreach ($orders as $order) { foreach ($orders as $order) {
//更新订单信息 //更新订单信息
$updateData = array('order_state' => ApiConst::orderStateCancel); $updateData = array('order_state' => ApiConst::orderStateCancel,'is_effective'=>ApiConst::cancelOrderAuto);
$update = $orderDao->update(array('order_id' => $order['orderId']),$updateData); $update = $orderDao->update(array('order_id' => $order['orderId']),$updateData);
$updateCommonData['order_message']=DescribeConst::cancelOrderMessage; $updateCommonData['order_message']=DescribeConst::cancelOrderMessage;
$res=$orderCommonDao->update(array('order_id'=>$order['orderId']),$updateCommonData); $res=$orderCommonDao->update(array('order_id'=>$order['orderId']),$updateCommonData);
...@@ -722,7 +723,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -722,7 +723,7 @@ class OrderServiceModel extends \Business\AbstractModel
if (!empty($orders)) { if (!empty($orders)) {
foreach ($orders as $order) { foreach ($orders as $order) {
//更新订单信息 //更新订单信息
$updateData = array('order_state' => ApiConst::orderStateClose,'refund_amount'=>$order['orderAmount']); $updateData = array('order_state' => ApiConst::orderStateClose,'refund_amount'=>$order['orderAmount'],'gmt_update'=>TIMESTAMP,'is_effective'=>ApiConst::closeOrder);
$update = $orderDao->update(array('order_id' => $order['orderId']),$updateData); $update = $orderDao->update(array('order_id' => $order['orderId']),$updateData);
if($update){ if($update){
if ($order['paymentTime'] > ApiConst::zero && in_array($order['paymentType'], ArrayConst::orderPayTypeOnlines)) { if ($order['paymentTime'] > ApiConst::zero && in_array($order['paymentType'], ArrayConst::orderPayTypeOnlines)) {
...@@ -775,12 +776,8 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -775,12 +776,8 @@ class OrderServiceModel extends \Business\AbstractModel
} }
file_put_contents($this->baseDir . \Our\PathConst::orderCloseWaitRecieveOrder, $endTime); file_put_contents($this->baseDir . \Our\PathConst::orderCloseWaitRecieveOrder, $endTime);
} }
public function updateDateGoodsStoregeByOrderGoods($orderGoods,$type=ApiConst::plus){
public function updateOrderGoodsStoregeByOrderIds($orderIds){
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$orderConfirmUtilDao=OrderConfirmUtil::getInstance(DbNameConst::masterDBConnectName); $orderConfirmUtilDao=OrderConfirmUtil::getInstance(DbNameConst::masterDBConnectName);
//更新商品库存
$orderGoods = $orderGoodsDao->getOrderGoodsByOrderIds($orderIds, $this->getGoodsDetailField());
$storeCartsList=array(); $storeCartsList=array();
$storeCarts=array(); $storeCarts=array();
$storeCarts['storeCarts']=array(); $storeCarts['storeCarts']=array();
...@@ -795,12 +792,49 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -795,12 +792,49 @@ class OrderServiceModel extends \Business\AbstractModel
} }
// $orderDao->updateNotRecieveOrders(ApiConst::orderStateWaitConfirm, ApiConst::orderStateClose, 'add_time', ApiConst::orderStateWaitConfirmBeyond, $this->orderMessageField); // $orderDao->updateNotRecieveOrders(ApiConst::orderStateWaitConfirm, ApiConst::orderStateClose, 'add_time', ApiConst::orderStateWaitConfirmBeyond, $this->orderMessageField);
try{ try{
$orderConfirmUtilDao->updateGoodsStorage($storeCartsList,\Our\ApiConst::plus); $orderConfirmUtilDao->updateGoodsStorage($storeCartsList,$type);
return true;
}catch(\Exception $ex){ }catch(\Exception $ex){
$orderidsStr=implode(',',$orderIds); $orderGoodsIds=array_column($orderGoods,'goodsId');
$orderidsStr=implode(',',$orderGoodsIds);
echo '商品库存更新失败:'.$ex->getMessage().$ex->getCode().":".$orderidsStr; echo '商品库存更新失败:'.$ex->getMessage().$ex->getCode().":".$orderidsStr;
} }
} }
public function updateOrderGoodsStoregeByOrderIds($orderIds,$orderGoodsId=false){
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(DbNameConst::masterDBConnectName);
//更新商品库存
$orderGoodses = $orderGoodsDao->getOrderGoodsByOrderIds($orderIds, $this->getGoodsDetailField());
$orderGoods=array();
if(!empty($orderGoodsId)){
foreach($orderGoodses as $orderGood){
if($orderGood['recId']==$orderGoodsId){
array_push($orderGoods,$orderGood);
}
}
}
if(empty($orderGoods)){
$orderGoods=$orderGoodses;
}
$this->updateDateGoodsStoregeByOrderGoods($orderGoods);
}
public function updateGoodsStoregeByGoodsIds($storeId,$goodsid,$num=ApiConst::zero,$type=ApiConst::plus){
$where['goods_id']=$goodsid;
$where['store_id']=$storeId;
$goodsDao = \DAO\GoodsModel::getInstance(DbNameConst::masterDBConnectName);
$goodses=$goodsDao->getList($where,$goodsDao->goodsDetailField);
if(!empty($goodses)){
foreach($goodses as &$goods){
$goods['goodsNum']=$num;
}
if($this->updateDateGoodsStoregeByOrderGoods($goodses,$type)){
return true;
}
}
return false;
}
//订单任务脚本自动确认收货 //订单任务脚本自动确认收货
public function canformRecieveOrder() public function canformRecieveOrder()
......
...@@ -187,7 +187,7 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -187,7 +187,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderDao->deleteOrderCache($refund['buyer_id'], $refund['order_id'], $refund['store_id']); $orderDao->deleteOrderCache($refund['buyer_id'], $refund['order_id'], $refund['store_id']);
$storeDAO->deleteStoreRefundCache($refund['store_id'],$refund['order_id']); $storeDAO->deleteStoreRefundCache($refund['store_id'],$refund['order_id']);
$orderService=\Business\Order\OrderServiceModel::getInstance(); $orderService=\Business\Order\OrderServiceModel::getInstance();
$orderService->updateOrderGoodsStoregeByOrderIds($refund['order_id']); $orderService->updateOrderGoodsStoregeByOrderIds($refund['order_id'],$refund['goods_id']);
$refundReturnDao->db->doCommit(); $refundReturnDao->db->doCommit();
$push=\Our\Push::getInstance(); $push=\Our\Push::getInstance();
$pushData=array('storeId'=>$storeId, $pushData=array('storeId'=>$storeId,
......
...@@ -407,7 +407,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -407,7 +407,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
public function getOrders($memberId, $pageIndex, $pageSize, $orderState, $keyword) public function getOrders($memberId, $pageIndex, $pageSize, $orderState, $keyword)
{ {
$order = array('gmt_update' => 'desc'); $order = array('add_time' => 'desc');
$orderDao=\DAO\Order\OrderModel::getInstance(); $orderDao=\DAO\Order\OrderModel::getInstance();
$storeId = $this->_getStoreByMemberId($memberId); $storeId = $this->_getStoreByMemberId($memberId);
if (empty($storeId)) { if (empty($storeId)) {
...@@ -436,15 +436,21 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -436,15 +436,21 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
// $where .= ' and han_order.shipping_type=' . ApiConst::bySelf; // $where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
$where=$orderDao->getByselfCondition($storeId); $where=$orderDao->getByselfCondition($storeId);
} else { } else {
// $order=array(
// 'diliveryman_id'=>'asc',
// 'gmt_update'=>'asc'
// );
$order=array( $order=array(
'diliveryman_id'=>'asc', 'add_time'=>'desc'
'gmt_update'=>'asc'
); );
// $where .= ' and han_order.shipping_type=' . ApiConst::bySeller; // $where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
$where=$orderDao->getWaitDeliveryCondition($storeId); $where=$orderDao->getWaitDeliveryCondition($storeId);
} }
} else { } else {
$order=array(
'add_time'=>'desc'
);
if (!empty($orderState)) { if (!empty($orderState)) {
$where .= ' and han_order.order_state=' . $orderState; $where .= ' and han_order.order_state=' . $orderState;
} }
......
...@@ -29,15 +29,63 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -29,15 +29,63 @@ class StoreServiceModel extends \Business\AbstractModel{
$beginTime = $beginTime ? $beginTime : ApiConst::zero; $beginTime = $beginTime ? $beginTime : ApiConst::zero;
$endTime = TIMESTAMP; $endTime = TIMESTAMP;
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select se.store_id from han_store_extend se where se.gmt_update > '.$beginTime.' ) and store_id in (select qs.store_id from han_qm_store_class qs where qs.gmt_update > '.$beginTime.' or (qs.deadline>'.$beginTime.' and qs.deadline<='.$endTime.'))';
$field = 'store_id,store_state,store_time,store_end_time,province_id,city_id,area_id,(select se.cashed_deposit from han_store_extend se where se.store_id=han_store.store_id) cashed_deposit,if((store_state=1 and store_end_time>=0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id), 0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id and qs.deadline>=0), 0)) service_fee';
$result = true; $result = true;
$storeDao = \DAO\StoreModel::getInstance(); $storeDao = \DAO\StoreModel::getInstance();
$statDao = \DAO\StatStoreModel::getInstance(DbNameConst::masterDBConnectName); $statDao = \DAO\StatStoreModel::getInstance(DbNameConst::masterDBConnectName);
// $store_tmp = array();
if($datas = $storeDao->getStores($where, $field)) { //更新报表 //更新店铺基础数据
echo 'in:'.count($datas); $where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select se.store_id from han_store_extend se where se.gmt_update > '.$beginTime.' )';
$field = 'store_id,store_name,store_state,store_time,store_end_time,province_id,city_id,area_id,(select se.cashed_deposit from han_store_extend se where se.store_id=han_store.store_id) cashed_deposit';
if($datas = $storeDao->getStores($where, $field)) {
echo 'extend in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_data['upd_time'] = $endTime;
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//更新店铺经营分类数据
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select qs.store_id from han_qm_store_class qs where qs.gmt_update > '.$beginTime.' or (qs.deadline>'.$beginTime.' and qs.deadline<='.$endTime.'))';
$field = 'store_id, (select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.store_id=han_store.store_id) class_style1_count, (select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id) class_style2_count, if((store_state=1 and store_end_time>=0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id), 0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id and qs.deadline>=0), 0)) service_fee';
if($datas = $storeDao->getStores($where, $field)) {
echo 'class in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_data['upd_time'] = $endTime;
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//更新店铺关注信息
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select fs.store_id from han_favorites_store fs where fs.fav_time > '.$beginTime.')';
$field = 'store_id,(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.store_id=han_store.store_id) fav_total,(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.fav_from=3 and fs.store_id=han_store.store_id) fav3_total';
if($datas = $storeDao->getStores($where, $field)) {
echo 'favorite in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_data['upd_time'] = $endTime;
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//更新店铺有效订单信息
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select ss.store_id from han_store_statistics ss where ss.add_time > '.$beginTime.')';
$field = 'store_id,(select t.order_count from han_store_statistics t where t.store_id=han_store.store_id limit 1) order_count,(select t.order_total from han_store_statistics t where t.store_id=han_store.store_id limit 1) order_total';
if($datas = $storeDao->getStores($where, $field)) {
echo 'statistics in:'.count($datas);
foreach ($datas as $key=>$val) { foreach ($datas as $key=>$val) {
$update_data = $val; $update_data = $val;
$update_data['upd_time'] = $endTime; $update_data['upd_time'] = $endTime;
...@@ -49,12 +97,74 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -49,12 +97,74 @@ class StoreServiceModel extends \Business\AbstractModel{
} }
} }
//更新店铺订单超时信息
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select o.store_id from han_order o where o.gmt_update > '.$beginTime.')';
$field = 'store_id,(select count(*) from han_order o where o.store_id=han_store.store_id) all_order_count,(select count(*) from han_order o where o.is_effective=1 and o.store_id=han_store.store_id) expire_order_count';
if($datas = $storeDao->getStores($where, $field)) {
echo 'statistics in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_date['expire_order_percent'] = intval($val['expire_order_count']/$val['all_order_count']*100);
$update_data['upd_time'] = $endTime;
unset($update_data['all_order_count']);
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//更新店铺退货退款信息
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select rr.store_id from han_refund_return rr where rr.gmt_update > '.$beginTime.')';
$field = 'store_id,(select count(distinct t.order_id) from han_refund_return t where t.store_id=han_store.store_id and t.seller_state!=3) refund_order_count,(select sum(t.refund_amount) from han_refund_return t where t.seller_state!=3 and t.store_id=han_store.store_id) refund_order_total';
if($datas = $storeDao->getStores($where, $field)) {
echo 'refund in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_data['upd_time'] = $endTime;
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//更新店铺举报信息
$where = 'store_id in (select ss.store_id from han_stat_store ss) and store_id in (select t.seller_id from han_report t where t.report_time > '.$beginTime.')';
$field = 'store_id,(select count(*) from han_report t where t.seller_id=han_store.store_id) report_count';
if($datas = $storeDao->getStores($where, $field)) {
echo 'favorite in:'.count($datas);
foreach ($datas as $key=>$val) {
$update_data = $val;
$update_data['upd_time'] = $endTime;
unset($update_data['store_id']);
$where = 'store_id='.$val['store_id'];
if(!$statDao->update($where, $update_data)){
$result = false;
}
}
}
//处理新店铺信息
$where = 'store_id not in (select ss.store_id from han_stat_store ss)'; $where = 'store_id not in (select ss.store_id from han_stat_store ss)';
$field = 'store_id,store_state,store_time,store_end_time,province_id,city_id,area_id,(select se.cashed_deposit from han_store_extend se where se.store_id=han_store.store_id) cashed_deposit';
$field .= ',(select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.store_id=han_store.store_id) class_style1_count, (select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id) class_style2_count, if((store_state=1 and store_end_time>=0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id), 0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id and qs.deadline>=0), 0)) service_fee';
$field .= ',(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.store_id=han_store.store_id) fav_total,(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.fav_from=3 and fs.store_id=han_store.store_id) fav3_total';
$field .= ',(select t.order_count from han_store_statistics t where t.store_id=han_store.store_id limit 1) order_count,(select t.order_total from han_store_statistics t where t.store_id=han_store.store_id limit 1) order_total';
$field .= ',(select count(*) from han_order o where o.store_id=han_store.store_id) all_order_count,(select count(*) from han_order o where o.is_effective=1 and o.store_id=han_store.store_id) expire_order_count';
$field .= ',(select count(distinct t.order_id) from han_refund_return t where t.store_id=han_store.store_id and t.seller_state!=3) refund_order_count,(select sum(t.refund_amount) from han_refund_return t where t.seller_state!=3 and t.store_id=han_store.store_id) refund_order_total';
$field .= ',(select count(*) from han_report t where t.seller_id=han_store.store_id) report_count';
if($datas = $storeDao->getStores($where, $field)) { //插入报表 if($datas = $storeDao->getStores($where, $field)) { //插入报表
echo 'not in:'.count($datas); echo 'not in:'.count($datas);
foreach ($datas as $key=>$val) { foreach ($datas as $key=>$val) {
$insert_data = $val; $insert_data = $val;
$insert_data['expire_order_percent'] = $val['all_order_count'] ? intval
($val['expire_order_count']/$val['all_order_count']*100) : 0;
$insert_data['upd_time'] = $endTime; $insert_data['upd_time'] = $endTime;
unset($insert_data['all_order_count']);
if(!$statDao->insert($insert_data)){ if(!$statDao->insert($insert_data)){
echo 'insert fail'.var_export($val, true)."\n"; echo 'insert fail'.var_export($val, true)."\n";
......
...@@ -535,7 +535,8 @@ class AddressServiceModel extends \Business\AbstractModel { ...@@ -535,7 +535,8 @@ class AddressServiceModel extends \Business\AbstractModel {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyAddressAndName); \Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyAddressAndName);
} }
if(!($address['tag_type']>=\Our\ApiConst::zero&&$address['tag_type']<=3)){ if(!($address['tag_type']>=\Our\ApiConst::zero&&$address['tag_type']<=3)){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongAddressTagType); //\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongAddressTagType);
$address['tag_type'] = \Our\ApiConst::zero;
} }
if($province){ if($province){
$province = mb_substr($province,0,2); $province = mb_substr($province,0,2);
......
...@@ -41,6 +41,7 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -41,6 +41,7 @@ class ShareServiceModel extends \Business\AbstractModel
$data['goodsId']=$goods['goods_id']; $data['goodsId']=$goods['goods_id'];
$data['goodsCommonid']=$goods['goods_commonid']; $data['goodsCommonid']=$goods['goods_commonid'];
$data['storeId']=$goods['store_id']; $data['storeId']=$goods['store_id'];
} }
} }
if($data['type']==ApiConst::shareGroup){ if($data['type']==ApiConst::shareGroup){
...@@ -60,6 +61,15 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -60,6 +61,15 @@ class ShareServiceModel extends \Business\AbstractModel
$data['imgUrl']=$storeDao->getStoreLabelSrc($store['store_label']); $data['imgUrl']=$storeDao->getStoreLabelSrc($store['store_label']);
$data['storeName']=$store['store_name']; $data['storeName']=$store['store_name'];
$data['desc']=$store['store_notice']; $data['desc']=$store['store_notice'];
$data['storeWorkingtime']=$store['store_workingtime'];
$data['buyerDistribution']=$store['buyer_distribution'];
$data['sellerDistribution']=$store['seller_distribution'];
$data['startShippingPrice']=$store['start_shipping_price'];
$data['freeShippingPrice']=$store['free_shipping_price'];
$data['storeStartTime']=$store['store_start_time'];
$data['storeCloseTime']=$store['store_close_time'];
} }
} }
......
...@@ -39,7 +39,8 @@ class AdvModel extends \DAO\AbstractModel{ ...@@ -39,7 +39,8 @@ class AdvModel extends \DAO\AbstractModel{
foreach($advs as $adv){ foreach($advs as $adv){
$advContent=unserialize($adv['adv_content']); $advContent=unserialize($adv['adv_content']);
if($advContent['adv_pic_url']){ if($advContent['adv_pic_url']){
$temp['href']=\Our\NameConst::httpPrefix.$advContent['adv_pic_url']; //$temp['href']=\Our\NameConst::httpPrefix.$advContent['adv_pic_url'];
$temp['href']=$advContent['adv_pic_url'];
} }
$temp['imageUrl']=\Our\Common::getStaticFile($advContent['adv_pic'],\Our\ImageConst::advPath); $temp['imageUrl']=\Our\Common::getStaticFile($advContent['adv_pic'],\Our\ImageConst::advPath);
$result[] = $temp; $result[] = $temp;
......
...@@ -20,7 +20,7 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -20,7 +20,7 @@ class GoodsModel extends \DAO\AbstractModel {
private $cartGoodsField = 'goods_id,goods_storage,store_id,goods_commonid,goods_name,goods_image,goods_spec,snapshot_id'; private $cartGoodsField = 'goods_id,goods_storage,store_id,goods_commonid,goods_name,goods_image,goods_spec,snapshot_id';
public $goodsDetailField='goods_id as goodsId,goods_commonid as goodsCommonid,goods_name as goodsName,store_id as storeId'; public $goodsDetailField='goods_id as goodsId,goods_commonid as goodsCommonid,goods_commonid as goodsCommonId,goods_name as goodsName,store_id as storeId';
/** /**
* 主键 * 主键
...@@ -74,7 +74,9 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -74,7 +74,9 @@ class GoodsModel extends \DAO\AbstractModel {
public function getList($where,$field){ public function getList($where,$field){
$this->setDb(); $this->setDb();
return $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll(); $res= $this->db->select($field)->from($this->_tableName)->where($where)->order('goods_storage','desc')->fetchAll();
return $res;
} }
public function getListGroup($where,$field,$groupField){ public function getListGroup($where,$field,$groupField){
$this->setDb($this->dbName); $this->setDb($this->dbName);
...@@ -500,8 +502,11 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -500,8 +502,11 @@ class GoodsModel extends \DAO\AbstractModel {
} }
unset($goods['goodsSpec']); unset($goods['goodsSpec']);
if(isset($goods['goodsGroup'])&&!empty($goods['goodsGroup'])){ if(isset($goods['goodsGroup'])&&!empty($goods['goodsGroup'])){
$goods['goodsGroup']=$this->getGoodsGroup($goods['goodsGroup']); $goods['goodsGroup']=$this->getGoodsGroup($goods['goodsGroup']);
$goods['goodsDiscountPrice']=array_sum($goods['goodsGroup'],'discountPrice');
$goods['goodsReduceAmount']=$goods['goodsPayPrice']-$goods['goodsDiscountPrice'];
}else{ }else{
$goods['goodsGroup']=array(); $goods['goodsGroup']=array();
} }
......
...@@ -30,6 +30,10 @@ class StoreTopSaleGoodsModel extends \DAO\AbstractModel{ ...@@ -30,6 +30,10 @@ class StoreTopSaleGoodsModel extends \DAO\AbstractModel{
public function pushChangeSaleStore($storeId){ public function pushChangeSaleStore($storeId){
$storeTopSaleGoodsRedis = \Redis\Db4\StoreTopSaleGoodsRedisModel::getInstance(); $storeTopSaleGoodsRedis = \Redis\Db4\StoreTopSaleGoodsRedisModel::getInstance();
$storeTopSaleGoodsRedis->tableLPush('TopSaleStores',$storeId); $storeTopSaleGoodsRedis->tableLPush('TopSaleStores',$storeId);
//删除购物车缓存
$cartRedis = \Redis\Db7\CartRedisModel::getInstance();
$memberCartKey = \Our\NameConst::memberStoreCartsPrefix.'*_'.$storeId;
$cartRedis->tableDelAll($cartRedis->tableKeys($memberCartKey));
} }
public function getChangedSaleStoreId(){ public function getChangedSaleStoreId(){
......
...@@ -263,7 +263,7 @@ class OrderModel extends \DAO\AbstractModel ...@@ -263,7 +263,7 @@ class OrderModel extends \DAO\AbstractModel
return $this->update($where, $data); return $this->update($where, $data);
} }
public function updateStatusByOrderId($orderIds, $status, $isConfirm = false) public function updateStatusByOrderId($orderIds, $status, $isConfirm = false,$is_effective=ApiConst::zero)
{ {
$this->setDb($this->dbName); $this->setDb($this->dbName);
if (is_array($orderIds)) { if (is_array($orderIds)) {
...@@ -276,6 +276,9 @@ class OrderModel extends \DAO\AbstractModel ...@@ -276,6 +276,9 @@ class OrderModel extends \DAO\AbstractModel
$data['is_receive_payment']=ApiConst::receivePayment; $data['is_receive_payment']=ApiConst::receivePayment;
$data['payment_time']=TIMESTAMP; $data['payment_time']=TIMESTAMP;
} }
$data['is_effective']=$is_effective;
$data['order_state'] = $status; $data['order_state'] = $status;
$data['finnshed_time']=TIMESTAMP; $data['finnshed_time']=TIMESTAMP;
if ($isConfirm) { if ($isConfirm) {
......
...@@ -260,6 +260,24 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -260,6 +260,24 @@ class OrderGoodsModel extends \DAO\AbstractModel {
$res=$this->db->from($this->_tableName)->select($this->sumGoodsNum)->where($where)->group("buyer_id")->group("store_id")->fetchAll(); $res=$this->db->from($this->_tableName)->select($this->sumGoodsNum)->where($where)->group("buyer_id")->group("store_id")->fetchAll();
return $res; return $res;
}
public function getMemberStoreOrderGoodsCountBak($storeIds,$memberIds){
$this->setDb($this->dbName);
$orderDao=\DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$whereOrder['store_id']=array('in',$storeIds);
$whereOrder['buyer_id']=array('in',$memberIds);
$whereOrder['order_state']=array('in',ArrayConst::orderCloseAndCancel);
$orderIds=$orderDao->getFieldByWhere($whereOrder,'order_id');
$where['store_id']=array('in',$storeIds);
$where['buyer_id']=array('in',$memberIds);
$where['is_refund']=array('neq',ApiConst::refundSuccess);
if($orderIds){
$where['order_id']=array('notin',$orderIds);
}
$where=$this->db->getSqlWhereByArray($where);
$res=$this->db->from($this->_tableName)->select($this->sumGoodsNum)->where($where)->group("buyer_id")->group("store_id")->fetchAll();
return $res;
} }
public function convertRefundOrderGoods($orderGoods,$orderGoodsId){ public function convertRefundOrderGoods($orderGoods,$orderGoodsId){
$newOrderGoods=Array(); $newOrderGoods=Array();
......
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>我的身边店</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link type="image/x-icon" rel="icon" href="//static.shenbd.com/lib/img/favicon-hd.ico" />
<link type="image/x-icon" rel="shortcut icon" href="//static.shenbd.com/lib/img/favicon.ico" />
<style>
body,blockquote,h1,h2,h3,h4,h5,h6,p,pre,dd,form,figure{margin:0}
legend{padding:0}
menu,ol,ul,dl,fieldset,input,textarea{margin:0;padding:0}
audio,video,canvas{*display:inline;*zoom:1}
:link,:visited{text-decoration:none}
[hidden],template{display:none}
a{text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}
address,cite,em{font-style:normal}
code,kbd,samp,tt{font-family:inherit;font-size:100%}
img{border-style:none;vertical-align:middle}
svg:not(:root){overflow:hidden}
summary{display:list-item}
h1,h2,h3,h4,h5,h6{font-size:100%}
small{font-size:83.3%}
sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}
table{border-collapse:collapse;border-spacing:0}
menu,ol,ul{list-style:none outside none}
fieldset{border:0}
textarea{-webkit-appearance:none;overflow-y:auto}
button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}
button,input{overflow:visible}
button,select{text-transform:none}
button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}
button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:none}
[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}
[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}
[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}
::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}
mark{background:#ff0;color:#000}
progress{display:inline-block;vertical-align:baseline}
.fl{float:left}
.fr{float:right}
*html .clearfix{zoom:1}
*+html .clearfix{zoom:1}
.clearfix:after{content:'\0020';display:table;clear:both}
.fs12{font-size:12px}
.fs14{font-size:14px}
.fb{font-weight:bolder}
.tc{text-align:center}
.tl{text-align:left}
.tr{text-align:right}
.global-footer{line-height:2;text-align:center}
.global-footer a:link{text-decoration:none}
.global-footer a:visited{text-decoration:none}
.global-footer a:hover{text-decoration:underline}
.global-footer a:active{text-decoration:underline}
.header .address:before, .header .follow:before, .notice:before, .footer:before { background-image: url("//static.shenbd.com/www/index/2018/img/app-share/sprite-app-share.png"); background-repeat: no-repeat; display: inline-block; vertical-align: middle; overflow: hidden; }
body { background: #fff; font-size: 14px; line-height: 1.5; font-family: "Helvetica Neue", Tahoma, "Microsoft Yahei", "PingFang SC", "ST Heiti", SimHei, sans-serif, "Helvetica Neue", Tahoma, SimSun, "PingFang SC", "ST Heiti", sans-serif; }
.wrap { max-width: 750px; margin: 0 auto; }
.header .address:before, .header .follow:before, .notice:before, .footer:before { background-image: url("//static.shenbd.com/www/index/2018/img/app-share/sprite-app-share.png"); background-repeat: no-repeat; display: inline-block; vertical-align: middle; overflow: hidden; }
body { background: #fff; font-size: 14px; line-height: 1.5; font-family: "Helvetica Neue", Tahoma, "Microsoft Yahei", "PingFang SC", "ST Heiti", SimHei, sans-serif, "Helvetica Neue", Tahoma, SimSun, "PingFang SC", "ST Heiti", sans-serif; }
.wrap { max-width: 750px; margin: 0 auto; }
.header { background-position: top center; background-repeat: no-repeat; font-size: 22px; }
.header-c1 { position: relative; }
.header-c2 { padding: 16px 4% 30px; }
.header .header-bg { width: 750px; height: 314px; display: block; }
.header .address { font-size: 30px; position: absolute; top: 30px; left: 4%; padding-left: 34px; text-shadow: 1px 1px 1px rgba(255,255,255,.8);}
.header .address:before { position: absolute; content: ''; width: 24px; height: 28px; left: 0; top: 8px; }
.header .info { overflow: hidden; line-height: 60px; }
.header .follow { float: right; color: #ff3419; border: 1px solid #ff3b1a; border: 1px solid rgba(255, 59, 26, 0.5); line-height: 36px; padding: 0 8px 0 36px; border-radius: 18px; margin: 11px 0 0 1em; font-size: 20px; position: relative; }
.header .follow:before { content: ''; width: 30px; height: 20px; background-position: -30px 0; position: absolute; left: 8px; top: 50%; margin-top: -10px; }
.header .shop-name { overflow: hidden; font-size: 40px; }
.header .time { margin-top: 12px; }
.header .tag { font-size: 0; margin: 10px -10px 0; }
.header .tag p { display: inline-block; font-size: 22px; padding: 0 .72em; border-radius: .8em; border: 1px solid #212121; border: 1px solid rgba(50, 43, 34, 0.5); margin: 20px 10px 0; white-space: nowrap; line-height: 1.6; }
.notice { position: relative; padding-left: 65px; color: #ff8b25; font-size: 22px; }
.notice:before { content: ''; width: 48px; height: 40px; background-position: 0 -40px; position: absolute; left: 0; top: 15px; }
.notice-in { border: 1px solid #ff8b25; padding: 12px 3.2258064516% 6px; border-radius: 12px; position: relative; }
.notice-in:before, .notice-in:after { content: ''; position: absolute; }
.notice-in:before { color: #ff8b25; left: -16px; border-left: 8px dashed transparent; border-top: 8px dashed transparent; border-bottom-style: solid; border-bottom-width: 8px; border-right-style: solid; border-right-width: 8px; top: 9px; }
.notice-in:after { color: #fff; left: -14px; top: 8px; z-index: 2; border-left: 8px dashed transparent; border-top: 8px dashed transparent; border-right-style: solid; border-right-width: 8px; border-bottom-style: solid; border-bottom-width: 8px; }
.notice-hd { text-align: center; position: relative; z-index: 2; line-height: 1; }
.notice-hd:before { content: ''; position: absolute; width: 100%; left: 0; height: 10px; top: 50%; margin-top: -5px; z-index: -1; background: #ffeddd; }
.notice-hd .title { line-height: 1.5; font-size: 24px; display: inline-block; padding: 0 .5rem; background: #fff; vertical-align: middle; }
.notice-bd { padding-top: 12px; }
.pn-share { padding: 20px 4% 0; }
.pn-share .code-box { position: relative; margin-top: 90px; padding: 0 4%; text-align: center; }
.pn-share .code-box .code-in img { position: absolute; top: 50%; left: 50%; margin-left:-130px; margin-top:-130px; }
.pn-share .code-box .code-txt { position: absolute; left: 0; right: 0; bottom: -1.5em; text-align: center; font-size: 22px; }
.pn-share .code-box .code1 { width: 320px; height: 320px; margin-left: -160px; margin-top: -160px; }
.pn-share .code-box .code2 { width: 260px; height: 260px; margin-left: -125px; margin-top: -125px; }
.footer { color: #bbb; font-size: 20px; text-align: center; margin-top: 136px; padding: 30px 0; }
.footer:before { content: ''; width: 23px; height: 28px; background-position: -60px 0; margin: 0 10px 6px 0; }
</style>
<!--<style>-->
<!--.header{ background-color: #ffa62e;}-->
<!--</style>-->
</head>
<script type="text/javascript" src="/data/js/qrcode.min.js"></script>
<body>
<div class="wrap">
<div class="header" style="background-color: #ffa62e;">
<div class="header-c1">
<div class="address"><?php echo $params['address'];?></div>
<img src="<?php echo $params['imgUrl'];?>" alt="" class="header-bg">
</div>
<div class="header-c2">
<div class="info">
<p class="follow">关注</p>
<div class="shop-name"><?php echo $params['storeName'];?></div>
</div>
<p class="time">营业时间:<?php echo $params['storeStartTime'].'-'.$params['storeCloseTime'];?></p>
<div class="tag">
<?php echo $params['buyerDistribution']?'<p>支持自提</p>':'';?>
<?php echo $params['sellerDistribution']?'<p>商家配送</p>':'';?>
<?php echo $params['startShippingPrice']?'<p>'.$params['startShippingPrice'].'起送</p>':'';?>
<?php echo $params['freeShippingPrice']?'<p>满'.$params['freeShippingPrice'].'免费配送</p>':'';?>
</div>
</div>
</div>
<div class="pn-share">
<div class="notice">
<div class="notice-in">
<div class="notice-hd">
<div class="title">店铺公告</div>
</div>
<div class="notice-bd">
<p><?php echo $params['desc'];?></p>
</div>
</div>
</div>
<!-- <div class="code-box">-->
<!-- <img src="//static.shenbd.com/www/index/2018/img/app-share/bg-code1.jpg" alt="">-->
<!-- <div class="code-in">-->
<!-- <img src="//static.shenbd.com/www/index/2018/img/app-share/code1.png" alt="" class="code1">-->
<!-- </div>-->
<!-- <p class="code-txt">长按图片识别二维码</p>-->
<!-- </div>-->
<div class="code-box">
<img src="/data/images/bg-code2.jpg" alt="">
<div id="qrcodeImg" class="code-in">
<!-- <img id="qrcodeImg" src="//static.shenbd.com/www/index/2018/img/app-share/code2.jpg" alt="">-->
</div>
<p class="code-txt">长按图片识别二维码</p>
</div>
</div>
<div class="footer">我的身边店提供技术服务</div>
</div>
</body>
<script>
new QRCode(document.getElementById('qrcodeImg'), {
text: '<?php echo $params['qrCode']."?x-oss-process=image/resize,m_fill,h_186,w_186";?>',
width: 250,
height: 250
});
</script>
</html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>我的身边店</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link type="image/x-icon" rel="icon" href="//static.shenbd.com/lib/img/favicon-hd.ico" />
<link type="image/x-icon" rel="shortcut icon" href="//static.shenbd.com/lib/img/favicon.ico" />
<style>
body,blockquote,h1,h2,h3,h4,h5,h6,p,pre,dd,form,figure{margin:0}
legend{padding:0}
menu,ol,ul,dl,fieldset,input,textarea{margin:0;padding:0}
audio,video,canvas{*display:inline;*zoom:1}
:link,:visited{text-decoration:none}
[hidden],template{display:none}
a{text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}
address,cite,em{font-style:normal}
code,kbd,samp,tt{font-family:inherit;font-size:100%}
img{border-style:none;vertical-align:middle}
svg:not(:root){overflow:hidden}
summary{display:list-item}
h1,h2,h3,h4,h5,h6{font-size:100%}
small{font-size:83.3%}
sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}
table{border-collapse:collapse;border-spacing:0}
menu,ol,ul{list-style:none outside none}
fieldset{border:0}
textarea{-webkit-appearance:none;overflow-y:auto}
button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}
button,input{overflow:visible}
button,select{text-transform:none}
button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}
button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:none}
[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}
[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}
[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}
::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}
mark{background:#ff0;color:#000}
progress{display:inline-block;vertical-align:baseline}
.fl{float:left}
.fr{float:right}
*html .clearfix{zoom:1}
*+html .clearfix{zoom:1}
.clearfix:after{content:'\0020';display:table;clear:both}
.fs12{font-size:12px}
.fs14{font-size:14px}
.fb{font-weight:bolder}
.tc{text-align:center}
.tl{text-align:left}
.tr{text-align:right}
.global-footer{line-height:2;text-align:center}
.global-footer a:link{text-decoration:none}
.global-footer a:visited{text-decoration:none}
.global-footer a:hover{text-decoration:underline}
.global-footer a:active{text-decoration:underline}
<html lang="en"> .header .address:before, .header .follow:before, .notice:before, .footer:before { background-image: url("//static.shenbd.com/www/index/2018/img/app-share/sprite-app-share.png"); background-repeat: no-repeat; display: inline-block; vertical-align: middle; overflow: hidden; }
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no"> body { background: #fff; font-size: 14px; line-height: 1.5; font-family: "Helvetica Neue", Tahoma, "Microsoft Yahei", "PingFang SC", "ST Heiti", SimHei, sans-serif, "Helvetica Neue", Tahoma, SimSun, "PingFang SC", "ST Heiti", sans-serif; }
<title></title>
<style type="text/css"> .wrap { max-width: 750px; margin: 0 auto; }
html,body,p,span,div,img{margin:0;padding:0;}body{width:750px;}
.shareC { width:750px; padding:0; text-align:center;font-family:"黑体";color:#212121;} .header .address:before, .header .follow:before, .notice:before, .footer:before { background-image: url("//static.shenbd.com/www/index/2018/img/app-share/sprite-app-share.png"); background-repeat: no-repeat; display: inline-block; vertical-align: middle; overflow: hidden; }
.header{background:url(/data/img/headerBg.png);padding-top:100px; height:415px; }
.bgBD{width:162px; height:162px;background-color:white;border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;margin:0 auto;} body { background: #fff; font-size: 14px; line-height: 1.5; font-family: "Helvetica Neue", Tahoma, "Microsoft Yahei", "PingFang SC", "ST Heiti", SimHei, sans-serif, "Helvetica Neue", Tahoma, SimSun, "PingFang SC", "ST Heiti", sans-serif; }
#headerBg{width:160px; height:160px;border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;margin:1px;}
#title{font-size:34px; margin-top:24px;} .wrap { max-width: 750px; margin: 0 auto; }
.address{ font-size:28px; line-height:36px; padding:50px 110px 0 110px; height:108px;display:block; display:-webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;overflow:hidden;text-overflow:ellipsis;}
.noticePart{ width:560px;margin:16px auto 0 auto; background:url(/data/img/noticeBg.png);} .header { background-position: top center; background-repeat: no-repeat; font-size: 22px; }
.noticePart p{height:44px; font-size:20px; line-height:22px; padding:68px 28px 32px 28px; } .header-c1 { position: relative; }
#notice{ max-width:504px;display:block; display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;overflow:hidden;text-overflow:ellipsis;} .header-c2 { padding: 16px 4% 30px; }
.qrcode{background:url(/data/img/flower.png); height:488px; margin:6px auto 0 auto;} .header .header-bg { width: 750px; height: 314px; display: block; }
#qrImg {margin-top:80px;} .header .address { font-size: 30px; position: absolute; top: 30px; left: 4%; padding-left: 34px; text-shadow: 1px 1px 1px rgba(255,255,255,.8);}
#qrcodeImg img { margin: 0 auto;} .header .address:before { position: absolute; content: ''; width: 24px; height: 28px; left: 0; top: 8px; }
.footer{ font-size:30px; height:66px; line-height:66px; padding:0 0 55px 0;} .header .info { overflow: hidden; line-height: 60px; }
.footer img{vertical-align:bottom; display:inline-block;} .header .follow { float: right; color: #ff3419; border: 1px solid #ff3b1a; border: 1px solid rgba(255, 59, 26, 0.5); line-height: 36px; padding: 0 8px 0 36px; border-radius: 18px; margin: 11px 0 0 1em; font-size: 20px; position: relative; }
.header .follow:before { content: ''; width: 30px; height: 20px; background-position: -30px 0; position: absolute; left: 8px; top: 50%; margin-top: -10px; }
.header .shop-name { overflow: hidden; font-size: 40px; }
.header .time { margin-top: 12px; }
.header .tag { font-size: 0; margin: 10px -10px 0; }
.header .tag p { display: inline-block; font-size: 22px; padding: 0 .72em; border-radius: .8em; border: 1px solid #212121; border: 1px solid rgba(50, 43, 34, 0.5); margin: 20px 10px 0; white-space: nowrap; line-height: 1.6; }
.notice { position: relative; padding-left: 65px; color: #ff8b25; font-size: 22px; }
.notice:before { content: ''; width: 48px; height: 40px; background-position: 0 -40px; position: absolute; left: 0; top: 15px; }
.notice-in { border: 1px solid #ff8b25; padding: 12px 3.2258064516% 6px; border-radius: 12px; position: relative; }
.notice-in:before, .notice-in:after { content: ''; position: absolute; }
.notice-in:before { color: #ff8b25; left: -16px; border-left: 8px dashed transparent; border-top: 8px dashed transparent; border-bottom-style: solid; border-bottom-width: 8px; border-right-style: solid; border-right-width: 8px; top: 9px; }
.notice-in:after { color: #fff; left: -14px; top: 8px; z-index: 2; border-left: 8px dashed transparent; border-top: 8px dashed transparent; border-right-style: solid; border-right-width: 8px; border-bottom-style: solid; border-bottom-width: 8px; }
.notice-hd { text-align: center; position: relative; z-index: 2; line-height: 1; }
.notice-hd:before { content: ''; position: absolute; width: 100%; left: 0; height: 10px; top: 50%; margin-top: -5px; z-index: -1; background: #ffeddd; }
.notice-hd .title { line-height: 1.5; font-size: 24px; display: inline-block; padding: 0 .5rem; background: #fff; vertical-align: middle; }
.notice-bd { padding-top: 12px; }
.pn-share { padding: 20px 4% 0; }
.pn-share .code-box { position: relative; margin-top: 90px; padding: 0 4%; text-align: center; }
.pn-share .code-box .code-in img { position: absolute; top: 50%; left: 50%; margin-left:-130px; margin-top:-130px; }
.pn-share .code-box .code-txt { position: absolute; left: 0; right: 0; bottom: -1.5em; text-align: center; font-size: 22px; }
.pn-share .code-box .code1 { width: 320px; height: 320px; margin-left: -160px; margin-top: -160px; }
.pn-share .code-box .code2 { width: 260px; height: 260px; margin-left: -125px; margin-top: -125px; }
.footer { color: #bbb; font-size: 20px; text-align: center; margin-top: 136px; padding: 30px 0; }
.footer:before { content: ''; width: 23px; height: 28px; background-position: -60px 0; margin: 0 10px 6px 0; }
</style> </style>
<!--<style>-->
<!--.header{ background-color: #ffa62e;}-->
<!--</style>-->
</head> </head>
<script type="text/javascript" src="/data/js/qrcode.min.js"></script>
<body> <body>
<div class="shareC"> <div class="wrap">
<div class="header"> <div class="header" style="background-color: #ffa62e;">
<div class="bgBD"> <div class="header-c1">
<img src="" id="headerBg" /> <div class="address"><?php echo $params['address'];?></div>
<img src="<?php echo $params['imgUrl'];?>" alt="" class="header-bg">
</div>
<div class="header-c2">
<div class="info">
<p class="follow">关注</p>
<div class="shop-name"><?php echo $params['storeName'];?></div>
</div>
<p class="time">营业时间:<?php echo $params['storeStartTime'].'-'.$params['storeCloseTime'];?></p>
<div class="tag">
<?php echo $params['buyerDistribution']?'<p>支持自提</p>':'';?>
<?php echo $params['sellerDistribution']?'<p>商家配送</p>':'';?>
<?php echo $params['startShippingPrice']?'<p>'.$params['startShippingPrice'].'起送</p>':'';?>
<?php echo $params['freeShippingPrice']?'<p>满'.$params['freeShippingPrice'].'免费配送</p>':'';?>
</div>
</div> </div>
<p id="title"></p>
<p class="address">地址:<span id="address"></span></p>
</div>
<div class="noticePart">
<p>
<span id="notice"></span>
</p>
</div>
<div class="qrcode" id="qrcode">
<img id="qrImg" src="" />
<div id="qrcodeImg"></div>
<p id="tip"></p>
</div> </div>
<div class="footer"> <div class="pn-share">
<img src="/data/img/logo.png" /> 我的身边店 <div class="notice">
<div class="notice-in">
<div class="notice-hd">
<div class="title">店铺公告</div>
</div>
<div class="notice-bd">
<p><?php echo $params['desc'];?></p>
</div>
</div>
</div>
<!-- <div class="code-box">-->
<!-- <img src="//static.shenbd.com/www/index/2018/img/app-share/bg-code1.jpg" alt="">-->
<!-- <div class="code-in">-->
<!-- <img src="//static.shenbd.com/www/index/2018/img/app-share/code1.png" alt="" class="code1">-->
<!-- </div>-->
<!-- <p class="code-txt">长按图片识别二维码</p>-->
<!-- </div>-->
<div class="code-box">
<img src="/data/images/bg-code2.jpg" alt="">
<div id="qrcodeImg" class="code-in">
<!-- <img id="qrcodeImg" src="//static.shenbd.com/www/index/2018/img/app-share/code2.jpg" alt="">-->
</div>
<p class="code-txt">长按图片识别二维码</p>
</div>
</div> </div>
<div class="footer">我的身边店提供技术服务</div>
</div> </div>
<script type="text/javascript" src="/data/js/qrcode.min.js"></script> </body>
<script type="text/javascript"> <script>
var pageObj = { new QRCode(document.getElementById('qrcodeImg'), {
type : "<?php echo $params['shareType'];?>",//1或2是小程序码,其它是二维码 text: '<?php echo $params['qrCode'];?>',
id : "<?php echo $params['id'];?>",//1是小程序码,2是二维码, width: 250,
headerBg : "<?php echo $params['imgUrl'];?>", height: 250
url : "<?php echo $params['qrCode'];?>",
qrImg : "<?php echo $params['qrCode'];?>",
title : "<?php echo $params['storeName'];?>",
address : "<?php echo $params['address'];?>",
notice : "<?php echo $params['desc'];?>"
};
if(pageObj.notice==null || pageObj.notice=="")
pageObj.notice="暂无公告";
var excute = ["title","address","notice"];
excute.forEach(function(v,i){
document.getElementById(v).innerHTML = pageObj[v];
});
document.getElementById("headerBg").src = pageObj.headerBg;
new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// if(pageObj.type<=2){
// document.getElementById("qrImg").src = pageObj.qrImg;}
// else{
// new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// }
});
</script> </script>
</body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<title></title>
<style type="text/css">
html,body,p,span,div,img{margin:0;padding:0;}body{width:750px;}
.shareC { width:750px; padding:0; text-align:center;font-family:"黑体";color:#212121;}
.header{background:url(/data/img/headerBg.png);padding-top:100px; height:415px; }
.bgBD{width:162px; height:162px;background-color:white;border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;margin:0 auto;}
#headerBg{width:160px; height:160px;border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;margin:1px;}
#title{font-size:34px; margin-top:24px;}
.address{ font-size:28px; line-height:36px; padding:50px 110px 0 110px; height:108px;display:block; display:-webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;overflow:hidden;text-overflow:ellipsis;}
.noticePart{ width:560px;margin:16px auto 0 auto; background:url(/data/img/noticeBg.png);}
.noticePart p{height:44px; font-size:20px; line-height:22px; padding:68px 28px 32px 28px; }
#notice{ max-width:504px;display:block; display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;overflow:hidden;text-overflow:ellipsis;}
.qrcode{background:url(/data/img/flower.png); height:488px; margin:6px auto 0 auto;}
#qrImg {margin-top:80px;}
#qrcodeImg img { margin: 0 auto;}
.footer{ font-size:30px; height:66px; line-height:66px; padding:0 0 55px 0;}
.footer img{vertical-align:bottom; display:inline-block;}
</style>
</head>
<body>
<div class="shareC">
<div class="header">
<div class="bgBD">
<img src="" id="headerBg" />
</div>
<p id="title"></p>
<p class="address">地址:<span id="address"></span></p>
</div>
<div class="noticePart">
<p>
<span id="notice"></span>
</p>
</div>
<div class="qrcode" id="qrcode">
<img id="qrImg" src="" />
<div id="qrcodeImg"></div>
<p id="tip"></p>
</div>
<div class="footer">
<img src="/data/img/logo.png" /> 我的身边店
</div>
</div>
<script type="text/javascript" src="/data/js/qrcode.min.js"></script>
<script type="text/javascript">
var pageObj = {
type : "<?php echo $params['shareType'];?>",//1或2是小程序码,其它是二维码
id : "<?php echo $params['id'];?>",//1是小程序码,2是二维码,
headerBg : "<?php echo $params['imgUrl'];?>",
url : "<?php echo $params['qrCode'];?>",
qrImg : "<?php echo $params['qrCode'];?>",
title : "<?php echo $params['storeName'];?>",
address : "<?php echo $params['address'];?>",
notice : "<?php echo $params['desc'];?>"
};
if(pageObj.notice==null || pageObj.notice=="")
pageObj.notice="暂无公告";
var excute = ["title","address","notice"];
excute.forEach(function(v,i){
document.getElementById(v).innerHTML = pageObj[v];
});
document.getElementById("headerBg").src = pageObj.headerBg;
new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// if(pageObj.type<=2){
// document.getElementById("qrImg").src = pageObj.qrImg;}
// else{
// new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// }
</script>
</body>
</html>
\ No newline at end of file
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<script src="//static.shenbd.com/lib/m/js/swiper-3.4.1.jquery.min.js"></script> <script src="//static.shenbd.com/lib/m/js/swiper-3.4.1.jquery.min.js"></script>
</head> </head>
<body class="page-index"> <body class="page-index">
<form>
<input name="data[image][]" />
</form>
<div class="wrap"> <div class="wrap">
<h1 class="logo"><a href="#"><img src="//static.shenbd.com/lib/img/logo.png" alt=""></a></h1> <h1 class="logo"><a href="#"><img src="//static.shenbd.com/lib/img/logo.png" alt=""></a></h1>
<section class="pn-download"> <section class="pn-download">
......
...@@ -84,8 +84,21 @@ class cliOrderClose extends basecli ...@@ -84,8 +84,21 @@ class cliOrderClose extends basecli
$stores=$goodsCommonService->getGoodsCount($storesIds); $stores=$goodsCommonService->getGoodsCount($storesIds);
if(!empty($stores)){ if(!empty($stores)){
foreach($stores as $store){ foreach($stores as $store){
$addData=array('storeId'=>$store['storeId'],'type'=>\Our\ApiConst::messageGoodsAlert,'op'=>\Our\NameConst::set,'alertCount'=>$store['count'],'params'=>array()); $push=\Our\Push::getInstance();
$push->addOneToClient($addData); $pushData=array('storeId'=>$store['storeId'],
'type'=>\Our\ApiConst::messageGoodsAlert,
'waitReceiveCount'=>ApiConst::zero,
'waitDeliveryCount'=>0,
'waitGetCount'=>0,
'orderCount'=>ApiConst::zero,
'waitRefundProccessCount'=>ApiConst::zero,
'waitRefundReceiveCount'=>ApiConst::zero,
'refundCount'=>ApiConst::zero,
'alertCount'=>$store['count'],
'params'=>array('c'=>'shopkeeper',
'm'=>'orderDetail',
'orderId'=>$store['orderId']));
$push->addOneToClient($pushData);
} }
} }
......
...@@ -7,13 +7,13 @@ error_reporting(E_ALL ^ E_NOTICE); ...@@ -7,13 +7,13 @@ error_reporting(E_ALL ^ E_NOTICE);
/** /**
* 店铺数据统计 * 店铺数据统计
* 执行时间:每分钟执行一次 * 执行时间:每分钟执行一次
* Class cliStoreStoreStat * Class cliStoreStat
* User: King <358887571@qq.com> * User: King <358887571@qq.com>
* Date: 2018/11/30 0030 * Date: 2018/11/30 0030
* Time: 下午 3:00 * Time: 下午 3:00
* *
*/ */
class cliStoreStoreStat extends basecli class cliStoreStat extends basecli
{ {
const CLI_ADMIN_ID = 255; const CLI_ADMIN_ID = 255;
private $bDoUnLock = FALSE; // 是否允许释放 LOCK 文件 private $bDoUnLock = FALSE; // 是否允许释放 LOCK 文件
...@@ -97,7 +97,7 @@ class cliStoreStoreStat extends basecli ...@@ -97,7 +97,7 @@ class cliStoreStoreStat extends basecli
} }
} }
$oCli = new cliStoreStoreStat(TRUE); $oCli = new cliStoreStat(TRUE);
EXIT; EXIT;
?> ?>
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