Commit 256f1d6d authored by liuyuzhen's avatar liuyuzhen

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

parents 49b29af5 e9800167
......@@ -157,8 +157,8 @@ class ArrayConst
);
const defaultDeliveryMan=array(
'id'=>0,
'trueName'=>'配送员a',
'mobile'=>'18650329907',
'trueName'=>'',
'mobile'=>'',
);
const messageOrderButtonsType=array(
0,1,2
......
......@@ -181,6 +181,10 @@ class NameConst {
const versionOne = '1.0.0';
const versionDefault = '1.0';
const bySeller='bySeller';
const bySelf='bySelf';
}
?>
\ No newline at end of file
......@@ -36,10 +36,14 @@ class OrderConst {
const refoundSuccess="已完成";
const sellerRefuse="卖家不同意退款";
const waitVerify="待商家确认";
const sellerAgree="已退款";
const sellerAgree="卖家同意退款";
const sellerAgreeReturn="卖家同意退款,货无需回收";
const alreadyReufndMoney="已退款";
const sellerRefuseGoods="商家已拒绝";
const sellerAgreeGoods="已退款";
// const sellerAgreeGoods="已退款";
const waitSellerRecieve='待收货';
const goodsStateUnRecieve='未收到货';
const goodsStateRecieved='已收货';
//订单列表描述信息
const unpayMessage="10分钟后未付款自动取消订单";
const payCancelMessage="付款后10分钟可取消订单";
......
......@@ -251,6 +251,10 @@ class MessageServiceModel extends \Business\AbstractModel
*/
public function getMemberList($memberId, $selfType, $toId, $otherId, $toType = ApiConst::systemMessageType, $field = '*', $pageIndex = ApiConst::pageIndex, $pageSize = ApiConst::pageSize)
{
if($memberId==$toId){
$toType=ApiConst::storeMessageType;
$selfType=ApiConst::memberMessageType;
}
$messageHistory = \DAO\MessageHistoryModel::getInstance();
$self = $this->getUserByMemberIdAndSelfType($memberId, $selfType);
if (empty($toId)) {
......@@ -352,6 +356,10 @@ class MessageServiceModel extends \Business\AbstractModel
public function update($fromId, $fromType, $toId, $toType)
{
if($fromId==$toId){
$fromType=ApiConst::memberMessageType;
$toType=ApiConst::storeMessageType;
}
$messageHistoryDao = \DAO\MessageHistoryModel::getInstance();
$messageOneDao = \DAO\MessageOneModel::getInstance();
$messageOneDao->setDb(DbNameConst::masterDBConnectName);
......
......@@ -292,9 +292,17 @@ class OrderServiceModel extends \Business\AbstractModel
$returnData['diliverymanId'] = ApiConst::zero;
$returnData['deliveryman'] = new \stdClass();
}
if(!in_array($this->order['paymentType'],ArrayConst::payTypeOnlines)){
$returnData['offlinePayway']=$storeDao->convertOfflinePayway($this->store['offlinePayway']);
}else{
$returnData['offlinePayway']=new \stdClass();
}
if(CURRENTVERSION!=NameConst::versionOne){
$returnData['offlinePayway']='';
}
$returnData['storeMemberId']=$this->store['memberId'];
$returnData['totalGoodsNum'] = $orderGoodsDao->getGoodsCount($this->orderGoodsList);
$returnData['offlinePayway'] = $this->store['offlinePayway'] ? $this->store['offlinePayway'] : '';
// $returnData['offlinePayway'] = $this->store['offlinePayway'] ? $this->store['offlinePayway'] : '';
$this->address['address']=$orderCommonDao->convertReceiveAddress($this->address['address']);
$returnData['reciverInfo'] = $this->address;
$returnData['reciverInfo']['mobPhone']=!empty($returnData['reciverInfo']['mobPhone'])?$returnData['reciverInfo']['mobPhone']:'';
......
......@@ -443,7 +443,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
$orderCommons=$orderDao->convertOrder($orderCommons,'orderId');
foreach ($refundMerge as &$value) {
$value['stateName'] = $refundReturnDao->getRefundTextStatus($value);
$value['stateName'] = $refundReturnDao->getRefundTextStatus($value,true);
/*$value['blId'] = isset($value['blId']) ? (!is_null($value['blId']) ? $value['blId'] : ApiConst::zero) : ApiConst::zero;
$value['canPlatformIn'] = $refundReturnDao->isPlatformIn($value) ? ApiConst::one : ApiConst::zero;
$value['canSendShippingType'] = $refundReturnDao->checkIsAddReturnShipping($value) ? ApiConst::one : ApiConst::zero;*/
......@@ -942,7 +942,8 @@ class RefundServiceModel extends \Business\AbstractModel
if($info['refundShippingType']==ApiConst::bySeller){
if($info['returnType']==ApiConst::returnTypeMustReturn){
if(!$info['diliverymanId']){
$info['diliveryman']=ArrayConst::defaultDeliveryMan;
$info['diliveryman']=new \stdClass();
// $info['diliveryman']=ArrayConst::defaultDeliveryMan;
}else{
$diliveryMan=$diliveryManDao->findById($info['diliverymanId']);
if(!empty($diliveryMan)){
......
......@@ -388,6 +388,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
{
$order = array('gmt_update' => 'desc');
$orderDao=\DAO\Order\OrderModel::getInstance();
$storeId = $this->_getStoreByMemberId($memberId);
if (empty($storeId)) {
ErrorModel::throwException(CodeConfigModel::paramsError);
......@@ -411,13 +412,16 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$where = 'han_order.store_id=' . $storeId;
if ($orderState == ApiConst::oneHandred || (int)$orderState == ApiConst::oneHandredOne) {
if ($orderState == ApiConst::oneHandred) {
$where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
// $where=$orderDao->getWaitDeliveryCondition();
// $where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
$where=$orderDao->getByselfCondition($storeId);
} else {
$order=array(
'diliveryman_id'=>'asc',
'gmt_update'=>'asc'
);
$where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
// $where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
$where=$orderDao->getWaitDeliveryCondition($storeId);
}
} else {
......@@ -916,8 +920,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeId = $memberDao->getInfo($memberId, 'store_id');
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$waitReceiveCount = $orderDao->getCountByOrderState($storeId, ApiConst::orderStateWaitConfirm);
$waitDeliveryCount = $orderDao->getCountByShippingTypeAndOrderState($storeId, ApiConst::bySeller, ApiConst::orderStateWaitRecieve);
$waitGetCount = $orderDao->getCountByShippingTypeAndOrderState($storeId, ApiConst::bySelf, ApiConst::orderStateWaitRecieve);
$waitDeliveryCount = $orderDao->getCountByShippingTypeAndOrderState($storeId);
$waitGetCount = $orderDao->getCountByShippingTypeAndOrderState($storeId,NameConst::bySelf);
$orderCount=$waitReceiveCount+$waitDeliveryCount+$waitGetCount;
return array('waitReceiveCount' => $waitReceiveCount, 'waitDeliveryCount' => $waitDeliveryCount, 'waitGetCount' => $waitGetCount,'orderCount'=>$orderCount);
}
......
......@@ -110,6 +110,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
'qrCode'=>$qrCode,
'memberName'=>$storeInfo['store_name'],
'memberAvatarUrl'=>$storeLabel,
'memberAvatarUrlR20'=>$storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20',
'goods'=>$goods ? array($goods) : $goods
];
}
......@@ -145,6 +146,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
'qrCode'=>$qrCode,
'memberName'=>$storeInfo['store_name'],
'memberAvatarUrl'=>$storeLabel,
'memberAvatarUrlR20'=>$storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20',
'goods'=>$data ? array($data) : $data
];
$hashData[$saleGoods[$id]][$saleGoods[$id].'_'.$memberId] = $qrCode;
......@@ -250,6 +252,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
$info['qrCode'] = $qrcode;
$info['memberName'] = $storeInfo['store_name'];
$info['memberAvatarUrl'] = $storeLabel;
$info['memberAvatarUrlR20'] = $storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20';
$info = array_merge($info,$goods);
}else{
\Error\ErrorModel::throwException(\Error\CodeConfigModel::saleActOrGoodsNotExist);
......
......@@ -72,7 +72,11 @@ class MessageHistoryModel extends \DAO\AbstractModel {
}
public function updateByFromIdAndSelfTypeAndToIdAndToType($fromId,$fromType,$toId,$toType){
if($fromId!=$toId){
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$fromType,$toType);
}else{
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$toType,$fromType);
}
$data['status']=ApiConst::read;
return $this->updateByWhere($where,$data);
}
......
......@@ -1035,7 +1035,8 @@ class OrderModel extends \DAO\AbstractModel
'buyerId' => 'buyer_id',
'deliveryTime' => 'delivery_time',
'evaluationState'=>'evaluation_state',
'orderNote'=>'order_note'
'orderNote'=>'order_note',
'isReceivePayment'=>'is_receive_payment'
);
}
......@@ -1127,10 +1128,35 @@ class OrderModel extends \DAO\AbstractModel
$count=$this->getCountByWhere($where);
return $count;
}
public function getCountByShippingTypeAndOrderState($storeId,$shippingType,$orderState){
$where['store_id']=$storeId;
$where['shipping_type']=$shippingType;
$where['order_state']=$orderState;
//获得店铺待配送或者待自提订单条件
public function getWaitDeliveryCondition($id,$memberType='seller'){
if($memberType=='seller'){
$where['store_id']=$id;
}else{
$where['member_id']=$id;
}
$where['shipping_type']=ApiConst::bySeller;
$where['order_state']=array('in',array(ApiConst::orderStateWaitSend,ApiConst::orderStateWaitRecieve));
return $where;
}
public function getByselfCondition($id,$memberType='seller'){
if($memberType=='seller'){
$where['store_id']=$id;
}else{
$where['member_id']=$id;
}
$where['shipping_type']=ApiConst::bySelf;
$where['order_state']=ApiConst::orderStateWaitRecieve;
return $where;
}
public function getCountByShippingTypeAndOrderState($storeId,$type=NameConst::bySeller){
if($type==NameConst::bySeller){
$where=$this->getWaitDeliveryCondition($storeId);
}
if($type==NameConst::bySelf){
$where=$this->getByselfCondition($storeId);
}
$count=$this->getCountByWhere($where);
return $count;
}
......
......@@ -163,26 +163,36 @@ class RefundReturnModel extends \DAO\AbstractModel {
return $this->getAll($where,$field);
}
public function getStatusExtent($returnRefund){
public function getStatusExtent($returnRefund,$isSeller=false){
// if($returnRefund['refundState']!=ApiConst::refundCompleted){
if($returnRefund['sellerState']==ApiConst::refundSellerAgree){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::refoundSuccess;
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['refundType']==ApiConst::refundTypeMoney){
return OrderConst::sellerAgree;
}
if($returnRefund['refundType']==ApiConst::refundTypeGoods){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::sellerAgreeGoods;
}else{
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['goodsState']==ApiConst::goodsStateUnRecieve){
return OrderConst::goodsStateUnRecieve;
}
if($returnRefund['goodsState']==ApiConst::goodsStateRecieved){
return OrderConst::goodsStateRecieved;
}
if($returnRefund['returnType']==ApiConst::returnTypeNotReturn){
return OrderConst::sellerAgreeReturn;
}
if($returnRefund['returnType']==ApiConst::returnTypeMustReturn){
return OrderConst::waitSellerRecieve;
}
}
}
if($returnRefund['sellerState']==ApiConst::refundSellerRefuse){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::refoundSuccess;
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['platformState']==ApiConst::platAgree){
return OrderConst::platFormAgree;
......@@ -204,15 +214,15 @@ class RefundReturnModel extends \DAO\AbstractModel {
// }else{
// return OrderConst::refoundSuccess;
// }
return '';
}
public function getRefundTextStatus($refundReturn){
public function getRefundTextStatus($refundReturn,$isSeller=false){
$refundText='';
switch($refundReturn['sellerState']){
case ApiConst::refundSellerVerify:$refundText=OrderConst::waitVerify;break;
case ApiConst::refundSellerAgree:$refundText=$this->getStatusExtent($refundReturn);break;
case ApiConst::refundSellerRefuse:$refundText=$this->getStatusExtent($refundReturn);break;
default: $refundText=$this->getStatusExtent($refundReturn,$isSeller);break;
}
return $refundText;
......
......@@ -2,6 +2,7 @@
namespace DAO;
use Our\ApiConst;
use Our\ArrayConst;
use Our\DbNameConst;
use Our\ImageConst;
......@@ -13,7 +14,7 @@ use Our\ImageConst;
class StoreModel extends \DAO\AbstractModel
{
public $detailField= " member_id as memberId,store_id as storeId,offline_payway as offlinePayway,store_label as storeLabel";
public $detailField = " member_id as memberId,store_id as storeId,offline_payway as offlinePayway,store_label as storeLabel,offline_payway as offlinePayway";
protected function init()
{
......@@ -35,6 +36,24 @@ class StoreModel extends \DAO\AbstractModel
protected $_primaryKey = 'store_id';
public function convertOfflinePayway($offlinPayway)
{
if (!empty($offlinPayway)) {
$offlinPayway=unserialize($offlinPayway);
$res['images']=[];
foreach($offlinPayway['images'] as $image){
$image= \Our\Common::getStaticFile($image, \Our\ImageConst::storeLabel);
array_push($res['images'],$image);
}
$res['payway']=$offlinPayway['payway']?$offlinPayway['payway']:'';
}
if(empty($res)){
$res=new \stdClass();
}
return $res;
}
/**
* 获取店铺信息
......@@ -52,7 +71,6 @@ class StoreModel extends \DAO\AbstractModel
}
public function getInfoById($id, $field = '*', $isField = false)
{
$this->setDb($this->dbName);
......@@ -83,7 +101,7 @@ class StoreModel extends \DAO\AbstractModel
* @param $storeLabel
* @return string
*/
public function getStoreLabelSrc($storeLabel, $width = \Our\ImageConst::circleStoreLabel, $height = 0)
public function getStoreLabelSrc($storeLabel, $width = \Our\ImageConst::circleStoreLabel, $height = 0,$original = false)
{
$width = ceil($width * \Our\ImageConst::sizeScale);
$height ? $height = ceil($height * \Our\ImageConst::sizeScale) : $height = $width;
......@@ -92,9 +110,12 @@ class StoreModel extends \DAO\AbstractModel
} else {
$storeLabel = \Our\Common::getStaticFile(ImageConst::defaultStoreLabelName, ImageConst::defaultPath);
}
if($original == false) {
$storeLabel .= "?x-oss-process=image/resize,m_fill,h_{$height},w_{$width}";
}
return $storeLabel;
}
/**
* 店铺首页banner
*
......@@ -111,6 +132,7 @@ class StoreModel extends \DAO\AbstractModel
$storeLabel .= "?x-oss-process=image/resize,m_fill,h_314,w_750";
return $storeLabel;
}
/**
* 店铺月销量
*
......@@ -132,12 +154,12 @@ class StoreModel extends \DAO\AbstractModel
* @param $field 可获取
* @return mixed 返回店铺列表
*/
public function getOnlineStores($where = null, $field = '*', $limit=[])
public function getOnlineStores($where = null, $field = '*', $limit = [])
{
$conditionSql = 'store_state =1 and open_flag =1 and (store_end_time >=' . TIMESTAMP . ' or store_end_time =0 ) ';
if ($where) {
$conditionSql = $where. ' and '.$conditionSql;
$conditionSql = $where . ' and ' . $conditionSql;
}
$result = $this->getStores($conditionSql, $field, $limit);
return $result;
......@@ -180,12 +202,13 @@ class StoreModel extends \DAO\AbstractModel
return $this->isChargeGet($storeId);
}
}
//获取是否应该收取服务费或快递费
public function isFee($storeId,$shippingtype,$orderStatus)
public function isFee($storeId, $shippingtype, $orderStatus)
{
if($shippingtype!=ApiConst::express){
return $this->isGetFee($storeId,$orderStatus);
}else{
if ($shippingtype != ApiConst::express) {
return $this->isGetFee($storeId, $orderStatus);
} else {
return $this->isChargeGet($storeId);
}
......@@ -197,12 +220,12 @@ class StoreModel extends \DAO\AbstractModel
* @param $field
* @return mixed
*/
public function getStores($where, $field = "*", $limit =[])
public function getStores($where, $field = "*", $limit = [])
{
$this->setDb();
if($limit){
$result = $this->db->select($field)->from($this->_tableName)->where($where)->limit($limit[0],$limit[1])->fetchAll();
}else{
if ($limit) {
$result = $this->db->select($field)->from($this->_tableName)->where($where)->limit($limit[0], $limit[1])->fetchAll();
} else {
$result = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
}
return $result;
......@@ -216,8 +239,9 @@ class StoreModel extends \DAO\AbstractModel
return $stores;
}
public function delStoresCacheByCityCode($cityCode){
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'),array(),array($cityCode));
public function delStoresCacheByCityCode($cityCode)
{
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'), array(), array($cityCode));
}
/**
......@@ -226,7 +250,7 @@ class StoreModel extends \DAO\AbstractModel
* @return mixed 当前城市列表
* @throws \Our\Exception
*/
public function getExpressStores( $field = 'store_id,store_longitude,store_latitude,max_sign_rang,max_sales_rang,store_sales_scope')
public function getExpressStores($field = 'store_id,store_longitude,store_latitude,max_sign_rang,max_sales_rang,store_sales_scope')
{
$storeClassCondition = " express_distribution = 1 ";
......@@ -235,9 +259,10 @@ class StoreModel extends \DAO\AbstractModel
return $stores;
}
public function deleteExpressStores($field = 'store_id,store_longitude,store_latitude,max_sign_rang,max_sales_rang,store_sales_scope'){
public function deleteExpressStores($field = 'store_id,store_longitude,store_latitude,max_sign_rang,max_sales_rang,store_sales_scope')
{
$storeClassCondition = " express_distribution = 1 ";
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'),array(array($storeClassCondition, $field)));
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'), array(array($storeClassCondition, $field)));
}
public function getNearbyStores($cityCode, $storeIds)
......@@ -248,51 +273,55 @@ class StoreModel extends \DAO\AbstractModel
return $returnStores;
}
public function delNearbyStoresCache($cityCode){
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'),array(),array($cityCode));
public function delNearbyStoresCache($cityCode)
{
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getOnlineStores'), array(), array($cityCode));
}
public function getAddress($storeId){
public function getAddress($storeId)
{
$storeInfo = $this->getStoreInfoCache($storeId);
//地址
$address = '';
if($storeInfo['area_info']){
if ($storeInfo['area_info']) {
$address .= $storeInfo['area_info'];
}
if($storeInfo['store_address']){
if ($storeInfo['store_address']) {
$address .= $storeInfo['store_address'];
}
return $address;
}
public function get($storeId,$label = true,$reportError = true)
public function get($storeId, $label = true, $reportError = true)
{
$storeInfo = $this->getStoreInfoCache($storeId);
if(!$storeInfo) {
if (!$storeInfo) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::storeNotExistOrClose);
}
if($storeInfo['open_flag'] != 1 || $storeInfo['store_state'] != 1){
if($reportError) {
if ($storeInfo['open_flag'] != 1 || $storeInfo['store_state'] != 1) {
if ($reportError) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::storeNotExistOrClose);
}else{
} else {
$storeInfo['isClose'] = 1;
}
}else{
} else {
$storeInfo['isClose'] = 0;
}
if($label){
if ($label) {
//店铺头像
$storeLabel = $this->getStoreLabelSrc($storeInfo['store_label']);
return array($storeInfo,$storeLabel);
return array($storeInfo, $storeLabel);
}
return $storeInfo;
}
public function getStoreInfoCache($storeId) {
$storeInfo = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(),array(&$this, 'getInfoById'),array($storeId),\Our\ApiConst::sevenDaySecond,array($storeId));
public function getStoreInfoCache($storeId)
{
$storeInfo = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$this, 'getInfoById'), array($storeId), \Our\ApiConst::sevenDaySecond, array($storeId));
return $storeInfo;
}
......@@ -315,18 +344,18 @@ class StoreModel extends \DAO\AbstractModel
*/
public function getShareInfo($storeInfo)
{
if(!is_array($storeInfo)){
$storeInfo = $this->get($storeInfo,false);
if (!is_array($storeInfo)) {
$storeInfo = $this->get($storeInfo, false);
}
$share['title'] = $storeInfo['store_share_title']?$storeInfo['store_share_title']:$storeInfo['store_name'];
$share['desc']= $storeInfo['store_share_desc']?$storeInfo['store_share_desc']:$storeInfo['store_notice'];
if($storeInfo['store_share_img']){
$share['title'] = $storeInfo['store_share_title'] ? $storeInfo['store_share_title'] : $storeInfo['store_name'];
$share['desc'] = $storeInfo['store_share_desc'] ? $storeInfo['store_share_desc'] : $storeInfo['store_notice'];
if ($storeInfo['store_share_img']) {
$img = $this->getStoreShareSrc($storeInfo['store_share_img']);
}else{
} else {
$img = $this->getStoreLabelSrc($storeInfo['store_label']);
}
$share['imgUrl'] = $img;
$share['link']='http://www.shenbd.com';
$share['link'] = 'http://www.shenbd.com';
return $share;
}
......@@ -336,15 +365,16 @@ class StoreModel extends \DAO\AbstractModel
* @param $store
* @return int
*/
public function checkAddressInServiceArea($address,$store){
public function checkAddressInServiceArea($address, $store)
{
$inAreaFlag = \Our\ApiConst::zero;
if($store['buyer_distribution']||$store['express_distribution']){//如果店铺开启了到店自提和快递配送,则认为存在可用配送方式
if ($store['buyer_distribution'] || $store['express_distribution']) {//如果店铺开启了到店自提和快递配送,则认为存在可用配送方式
$inAreaFlag = \Our\ApiConst::one;
return $inAreaFlag;
}
if($store['seller_distribution']&&$address){
$result = \Store\StoreUtil::getInstance()->checkAddressInServiceArea(array('lng'=>$address['lng'],'lat'=>$address['lat']),$store['store_id']);
if($result){
if ($store['seller_distribution'] && $address) {
$result = \Store\StoreUtil::getInstance()->checkAddressInServiceArea(array('lng' => $address['lng'], 'lat' => $address['lat']), $store['store_id']);
if ($result) {
$inAreaFlag = \Our\ApiConst::one;
}
}
......@@ -352,7 +382,6 @@ class StoreModel extends \DAO\AbstractModel
}
/**
* 类实例
*
......@@ -365,7 +394,7 @@ class StoreModel extends \DAO\AbstractModel
*
* @return \DAO\UserModel
*/
public static function getInstance($dbName=\Our\DbNameConst::salveDBConnectName)
public static function getInstance($dbName = \Our\DbNameConst::salveDBConnectName)
{
if (!(self::$_instance instanceof self)) {
self::$_instance = new self($dbName);
......@@ -449,23 +478,25 @@ class StoreModel extends \DAO\AbstractModel
);
}
public function getAll($where=array()){
public function getAll($where = array())
{
$this->setDb($this->dbName);
if($where){
$where=$this->db->getSqlWhereByArray($where);
if ($where) {
$where = $this->db->getSqlWhereByArray($where);
}
if($where){
$res=$this->db->from($this->_tableName)->where($where)->fetchAll();
}else{
$res=$this->db->from($this->_tableName)->fetchAll();
if ($where) {
$res = $this->db->from($this->_tableName)->where($where)->fetchAll();
} else {
$res = $this->db->from($this->_tableName)->fetchAll();
}
$resArray=array();
foreach($res as $val){
$resArray[$val['store_id']]=$val;
$resArray = array();
foreach ($res as $val) {
$resArray[$val['store_id']] = $val;
}
return $resArray;
}
/**
* 保存用户信息
*/
......@@ -476,7 +507,8 @@ class StoreModel extends \DAO\AbstractModel
return $result;
}
public function save($data,$where){
public function save($data, $where)
{
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$result = $this->db->update($this->_tableName)->rows($data)->where($where)->execute();
return $result;
......
......@@ -95,6 +95,11 @@ config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.indexUrl="/www/web/test_qm_com/application/library/React"
config.url.libary="/www/web/test_qm_com/application/library"
config.url.source="/www/web/test_qm_com/public_html/data/upload/"
;config.url.source="E:/WAMP/www/www.qm.com/data/upload/"
; 文件目录
;店铺图片报错目录
......
......@@ -107,7 +107,10 @@ $serv->on('Message', function($server, $frame) use($conf){
$sendMessage['toType']= $rev_data['toType'];
if(!empty($sendFd)){
echo '发送fd:'.$sendFd;
if($sendFd!=$frame->fd){
$server->push($sendFd, responseJson(1,"fromMsg","success", $sendMessage));
}
}
echo 'afterSendFd:'.$sendFd;
}
......
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