Commit ec82f263 authored by wwccw0591's avatar wwccw0591

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

parents c30aa815 479665a0
File mode changed from 100644 to 100755
......@@ -12,8 +12,9 @@ class CityController extends \Our\Controller_AbstractIndex {
}
public function getCityListAction(){
$fromWx = $this->req[\Our\NameConst::data]['fromWx'];
$addressService = \Business\User\AddressServiceModel::getInstance();
$cityList = $addressService->getCityList();
$cityList = $addressService->getCityList($fromWx);
$this->success($cityList);
}
}
\ No newline at end of file
File mode changed from 100644 to 100755
......@@ -92,6 +92,7 @@ class HomeController extends \Our\Controller_AbstractIndex{
$this->success($nearbyStores);
}
/**
* 设置首页推荐分类
* @param bool $flag
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100755 to 100644
......@@ -43,6 +43,7 @@ class OrderConfirmUtil {
public function addOrder($data,$memberId,$currentAddress){
$storeCartData = $this->checkPostData($data,$memberId,$currentAddress);
//return $storeCartData;
$storeCartData = $this->checkDeliveryTypeAndPayway($storeCartData);
return $this->saveOrderInfo($storeCartData);
}
......@@ -221,7 +222,7 @@ class OrderConfirmUtil {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder);
}
if($tempStore['goodsFreight']==\Our\ApiConst::zero&&!($tempStore['is_transport']&&$tempStore['transport_id']>\Our\ApiConst::zero&&isset($temp['shippingFee']))){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder);
\Error\ErrorModel::throwException(\Error\CodeConfigModel::noExpressDeliveryForOrder1);
}
$deliveryFee = $temp['shippingFee'];
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -164,6 +164,8 @@ class NameConst {
const frontLogPath = '/data/log/';
const frontPrefix = 'front';
const blGoods = '_goodsCommon';
}
?>
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -371,7 +371,7 @@ class CartServiceModel extends \Business\AbstractModel{
if(!(isset($data['goodsNum'])&&intval($data['goodsNum'])>\Our\ApiConst::zero)){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyCartBlNum);
}
$this->checkBundlingGoods($pBundling,$data['goodsNum'],true);
$this->checkBundlingGoods($pBundling,$data['goodsNum']);
}
return true;
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -333,7 +333,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId));
$html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>\Our\Common::getBaseUrl().'/index/goodsDetail?goodsCommonId='.$goodsCommonId);
if($commonInfo['is_del'] == 1) $commonInfo['goods_state'] == 0;
if($commonInfo['is_del'] == 1) $commonInfo['goods_state'] = 0;
unset($attrs['commonInfo']);
return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url']),$attrs);
}
......@@ -865,18 +865,19 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$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) {
$orders = $orderDao->getSaleOrderGoods('rec_id,sale_act_id,sale_id,han_order_goods.goods_id,han_order_goods.goods_num,han_order_goods.goods_name,han_order_goods.goods_image,han_order_goods.order_id,is_refund,goods_pay_price,han_order_goods.refund_id,order_state,han_order.order_sn,han_order.buyer_id,han_order.store_id,seller_state', $addTime, $pageBegin, \Our\PageConst::taskPageSize);
foreach ($orders as $orderGoods) {
$saleOrder = \DAO\SaleOrderModel::getInstance()->find(array('order_goods_id'=>$orderGoods['rec_id']),'id');
$insert = [];
$update = [];
$order = \DAO\Order\OrderModel::getInstance()->findByOrderId($orderGoods['order_id'],'order_state,order_sn,buyer_id');
if($saleOrder){
$update['is_refund'] = $orderGoods['is_refund'];
$update['order_state'] = $order['order_state'];
$update['order_state'] = $orderGoods['order_state'];
$update['seller_state'] = $orderGoods['seller_state'];
}else{
$member = \DAO\MemberModel::getInstance()->getInfo($order['buyer_id']);
$member = \DAO\MemberModel::getInstance()->getInfo($orderGoods['buyer_id']);
$insert['member_name'] = $member['memberName'];
$insert['store_id'] = $orderGoods['store_id'];
$insert['member_avatar'] = $member['memberAvatarUrl'];
$insert['order_goods_id'] = $orderGoods['rec_id'];
$insert['sale_act_id'] = $orderGoods['sale_act_id'];
......@@ -886,19 +887,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$insert['goods_name'] = $orderGoods['goods_name'];
$insert['goods_image'] = $orderGoods['goods_image'];
$insert['order_id'] = $orderGoods['order_id'];
$insert['member_id'] = $order['buyer_id'];
$insert['order_state'] = $order['order_state'];
$insert['member_id'] = $orderGoods['buyer_id'];
$insert['order_state'] = $orderGoods['order_state'];
$insert['is_refund'] = $orderGoods['is_refund'];
$insert['order_sn'] = $order['order_sn'];
$insert['order_sn'] = $orderGoods['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'];
}else{
$insert['seller_state'] = $refund['seller_state'];
}
$insert['seller_state'] = $orderGoods['seller_state'];
}
if($saleOrder){
\DAO\SaleOrderModel::getInstance(\Our\DbNameConst::masterDBConnectName)->update(array('order_goods_id'=>$orderGoods['rec_id']),$update);
......@@ -906,7 +900,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
\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']));
\Our\RedisHelper::delCachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(), array(&$saleOrderDAO, 'getOrderGoodsList'),array(),array($orderGoods['buyer_id']));
}
$pageBegin++;
} while (!empty($orders['list']));
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -395,9 +395,13 @@ class AddressServiceModel extends \Business\AbstractModel {
* 获取城市列表
* @return bool
*/
public function getCityList(){
public function getCityList($fromWx=false){
$areaDao =\DAO\AreaModel::getInstance();
$citList = $areaDao->getCityList();
if($fromWx){
$citList = $areaDao->getCityListWithoutCounty();
}else{
$citList = $areaDao->getCityList();
}
if($citList){
return $citList;
}
......
......@@ -17,8 +17,10 @@ class FootprintServiceModel extends \Business\AbstractModel
* @param $memberId
*/
public function getDate($param,$memberId){
$month = isset($param['month']) ? (int)$param['month'] : date('m');
$year = isset($param['year']) ? (int)$param['year'] : date('Y');
// $month = isset($param['month']) ? (int)$param['month'] : date('m');
// $year = isset($param['year']) ? (int)$param['year'] : date('Y');
$month = date('m');
$year = date('Y');
$sort = isset($param['sort']) ? (int)$param['sort'] : 1;
$sort == 1 ? $order = ['browsedate','ASC'] : $order = ['browsedate','DESC'];
$startTime = mktime(0,0,0,$month-2,1,$year);
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -50,6 +50,32 @@ class AreaModel extends \DAO\AbstractModel {
return $result;
}
public function getCityListWithoutCounty(){
$addressRedis = AddressRedisModel::getInstance();
$cityList = $addressRedis->find('cityListWithoutCounty');
if($cityList){
return $cityList;
}
$areaList = $this->getAllCityList(true);
$addressRedis->update('allCityListWithoutCounty',$areaList);
$cityListInitial = array();
$cityInitialList = array();
foreach($areaList as $area){
if(isset($area['initial'])&&$area['initial']&&!($cityInitialList&&in_array($area['initial'],$cityInitialList))){
$cityInitialList[] = $area['initial'];
}
$cityListInitial[$area['initial']][] = $area['area_name'];
}
$list = array();
foreach($cityInitialList as $inital){
$initalCity['initial'] = $inital;
$initalCity['list'] = $cityListInitial[$inital];
$list[] = $initalCity;
}
$addressRedis->update('cityListWithoutCounty',$list);
return $list;
}
public function getCityList(){
$addressRedis = AddressRedisModel::getInstance();
......@@ -78,14 +104,18 @@ class AreaModel extends \DAO\AbstractModel {
return $list;
}
public function getAllCityList(){
public function getAllCityList($withoutCounty=false){
$this->setDb($this->dbName);
$sql = " SELECT t1.area_name, t2.f_py as initial FROM han_area t1 ";
$sql .= " left join han_coslers t2 ";
$sql .= " on CONV(HEX(LEFT(CONVERT(t1.area_name USING gbk ), 1)), 16, 10) BETWEEN t2.cbegin AND t2.cend
where t1.is_city=1 ";
if($withoutCounty){
$sql .= " and t1.area_name not like '%县'";
}
$sql .= " ORDER BY t1.area_deep,convert(t1.area_name using gbk) ASC ";
$area_list = $this->db->query($sql)->rows;
echo $this->db->getLastSql();
return $area_list;
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -192,6 +192,7 @@ class GoodsModel extends \DAO\AbstractModel {
$goodsCommonRedis->tableHIncrBy($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum);
}
}
\DAO\PBundlingModel::getInstance()->deletePBundlingByGoodsCommonId($goodsCommonId);
}
return true;
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -188,12 +188,10 @@ class OrderGoodsModel extends \DAO\AbstractModel {
}
//销售订单
public function getSaleOrderGoods($field,$updateTime,$pageIndex,$pageSize) {
$pageIndex += 1;
$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;
return $this->db->select($field)->from($this->_tableName)->join('han_order',"han_order.order_id = han_order_goods.order_id",'inner')->join('han_refund_return','han_order_goods.refund_id = han_refund_return.refund_id','left')->where("sale_act_id > 0 AND (han_order_goods.gmt_update > {$updateTime} OR han_order.gmt_update > {$updateTime} OR han_refund_return.gmt_update > {$updateTime})")->page($pageIndex,$pageSize)->fetchAll();
}
public function insertAll($datas){
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$error = 0;
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -102,6 +102,7 @@ class PBundlingModel extends \DAO\AbstractModel {
}
$pBundlingRedis = \Redis\Db4\PBundlingRedisModel::getInstance();
$result = $pBundlingRedis->tableHSet(\Our\NameConst::onlineStorageBlGoodsPrefix,$blId,$storeage,\Our\ApiConst::oneDaySecond);
$this->deletePBundlingByBlId($blId);
return $result;
}
......@@ -142,6 +143,21 @@ class PBundlingModel extends \DAO\AbstractModel {
public function getPBundlingCacheByBlId($blId){
$pBundlingDao = \Redis\Db4\PBundlingRedisModel::getInstance();
return $pBundlingDao->getByKeys('gid_'.$blId);
}
public function deletePBundlingByBlId($blId){
$pBundlingDao = \Redis\Db4\PBundlingRedisModel::getInstance();
$pBundlingDao->tableDelAll($pBundlingDao->tableKeys('gid_'.$blId));
}
public function deletePBundlingByGoodsCommonId($goodsCommonId){
$pBundlingDao = \Redis\Db4\PBundlingRedisModel::getInstance();
$pBundlingDao->tableDelAll($pBundlingDao->tableKeys('*'.\Our\NameConst::blGoods.$goodsCommonId));
}
/**
* 类实例
*
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -275,6 +275,8 @@ class CodeConfigModel {
const noExpressDeliveryForOrder1 = 30115;
const goodsNoStoreForCartOrOrder1 = 30116;
const platFormAreadyIn=300117;
const noEnoughStorageForBundlingGoods = 30118;
//店铺相关错误码
//商品分类
......@@ -741,6 +743,7 @@ class CodeConfigModel {
self::notExistOrderGoods => '退款商品不存在',
self::noExpressDeliveryForOrder1 => '该店铺未配置快递配送',
self::goodsNoStoreForCartOrOrder1 => '商品库存紧张,您的购买数量太多啦',
self::noEnoughStorageForBundlingGoods =>'组合销售库存紧张,您购买的数量太多啦',
//销售员
self::emptySaleGoodsId=>'商品id不能为空',
self::emptySaleGoods=>'销售商品不存在',
......
File mode changed from 100644 to 100755
......@@ -129,6 +129,10 @@ class AbstractModel {
return $this->getRedis()->get($this->_addPrefix($key));
}
public function getNoPrefix($key){
return $this->getRedis()->get($key);
}
/**
* redis自增1
*
......
......@@ -27,6 +27,26 @@ class AbstractModel extends \Redis\AbstractModel {
$result = $this->get($this->calcKey($id));
return $result;
}
/**
* 通过前缀获取单个对象
* @param $id
* @return bool|mixed|string
*/
public function getByKeys($id){
$str = $this->tableKeys($id);
if($str){
$str = $str[0];
$result = $this->getNoPrefix($str);
if($this->is_serialized($result)){
return unserialize($result);
}
return $result;
}else{
return false;
}
}
public function tableCacheSet($id,$data,$experio){
$res=$this->set($this->calcKey($id), $data,$experio);
return $res;
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -27,7 +27,7 @@
</div>
<script type="text/javascript">
function goToDetail(problemId){
window.location.href = '/qa/detail?id='+problemId;
location.href = '/qa/detail?id='+problemId;
}
</script>
</body>
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
{"type":"1","content":{"className":"\\DAO\\MemberModel","method":"getMemberAvatarUrl","params":["260","http:\/\/thirdqq.qlogo.cn\/qqapp\/1106959346\/73308A441DEC867A013C7238782B440B\/100"]}}["260","http:\/\/thirdqq.qlogo.cn\/qqapp\/1106959346\/73308A441DEC867A013C7238782B440B\/100"]success
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
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