Commit 7748b87a authored by wwccw0591's avatar wwccw0591

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

parents df28dae1 434102e1
...@@ -21,6 +21,14 @@ class IndexController extends \Our\Controller_Abstract { ...@@ -21,6 +21,14 @@ class IndexController extends \Our\Controller_Abstract {
return false; return false;
} }
public function getQrcodeFlowAction(){
$imageKey=$_GET['imageKey'];
$memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
$imageFlow=$memberDb0Redis->tableCacheGet($imageKey);
header('Content-type: image/jpg');
echo $imageFlow;
exit;
}
public function getHtmlAction(){ public function getHtmlAction(){
$this->req=$this->getRequest()->getQuery(); $this->req=$this->getRequest()->getQuery();
$postData=$this->req; $postData=$this->req;
...@@ -37,7 +45,7 @@ class IndexController extends \Our\Controller_Abstract { ...@@ -37,7 +45,7 @@ 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->tableCacheGet($this->key);
if($_GET['debug']==1){ if($_GET['debug']==1){
$paramsStr='{ $paramsStr='{
"desc": "最优质的产品,最实惠的价格,最好的服务质量,欢迎选购", "desc": "最优质的产品,最实惠的价格,最好的服务质量,欢迎选购",
......
...@@ -720,7 +720,11 @@ class OrderConfirmUtil { ...@@ -720,7 +720,11 @@ class OrderConfirmUtil {
public function delCouponCahce(){ public function delCouponCahce(){
$memberCouponDao = \DAO\Coupon\MemberCouponModel::getInstance(); $memberCouponDao = \DAO\Coupon\MemberCouponModel::getInstance();
$couponService = \Business\Coupon\CouponServiceModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(),array(&$memberCouponDao, 'getList'),array(),array($this->memberId)); \Our\RedisHelper::delCachedFunction(\Redis\Db13\MemberCouponRedisModel::getInstance(),array(&$memberCouponDao, 'getList'),array(),array($this->memberId));
foreach($this->storeIds as $tempStoreId){
\Our\RedisHelper::delCachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$couponService, 'getStoreCouponsById'),array(),array($tempStoreId."_".$this->memberId));
}
} }
public function delCartCache(){ public function delCartCache(){
...@@ -1227,12 +1231,12 @@ class OrderConfirmUtil { ...@@ -1227,12 +1231,12 @@ class OrderConfirmUtil {
} }
} }
} }
$storeGoodsList['gcPrices'] = isset($storeGcCouponPriceArray); $storeGoodsList['gcPrices'] = isset($storeGcCouponPriceArray)?$storeGcCouponPriceArray:array();
$storeGoodsList['goodsCommonPrices'] = $storeGoodsCommonCouponPriceArray; $storeGoodsList['goodsCommonPrices'] = $storeGoodsCommonCouponPriceArray;
$storeGoodsList['storeCouponPrice'] = $storeCouponPrice; $storeGoodsList['storeCouponPrice'] = $storeCouponPrice;
$reliefAmount = $cartService->getOneCouponReliefAmount($coupon,$storeGoodsList); $reliefAmount = $cartService->getOneCouponReliefAmount($coupon,$storeGoodsList);
if($reliefAmount&&$reliefAmount>\Our\ApiConst::zero){ if($reliefAmount&&$reliefAmount>\Our\ApiConst::zero){
$totalPrice = $totalPrice-$reliefAmount; $totalPrice = ($reliefAmount > $totalPrice)? 0 : ($totalPrice-$reliefAmount);
} }
return $totalPrice; return $totalPrice;
} }
......
...@@ -312,6 +312,7 @@ class ApiConst ...@@ -312,6 +312,7 @@ class ApiConst
const signClassStyle = 2; const signClassStyle = 2;
const isEffective=0; const isEffective=0;
const notEffectiveAllRefund=3;
const defaultAddressCount = 3; const defaultAddressCount = 3;
...@@ -368,7 +369,7 @@ class ApiConst ...@@ -368,7 +369,7 @@ class ApiConst
//等于0表示没有选中地址时是选中当前传入经纬度,等于1表示没有命中地址是选中地址列表中按照is_default desc,address_id desc倒序的第一条地址 //等于0表示没有选中地址时是选中当前传入经纬度,等于1表示没有命中地址是选中地址列表中按照is_default desc,address_id desc倒序的第一条地址
const defaultAddressRoute = 0; const defaultAddressRoute = 0;
const shareLimitProgrameError=40001;
const addGoodsToCart = 1; //将商品加入购物车 const addGoodsToCart = 1; //将商品加入购物车
const addBundingToCart = 2; //将组合销售商品加入购物车 const addBundingToCart = 2; //将组合销售商品加入购物车
const positionPickupCodeBegin=12; const positionPickupCodeBegin=12;
...@@ -430,7 +431,7 @@ class ApiConst ...@@ -430,7 +431,7 @@ class ApiConst
const xpClientAppVersionOnline='1.0.0'; const xpClientAppVersionOnline='1.0.0';
const winClientAppVersionOnline='1.0.0'; const winClientAppVersionOnline='1.0.0';
//微信小是否发布 //微信小是否发布
const isWxPublish = 0; const isWxPublish = 1;
//消息模板类型 //消息模板类型
const reachRemindMessageType = 1; const reachRemindMessageType = 1;
......
This diff is collapsed.
...@@ -94,7 +94,7 @@ class ImageConst{ ...@@ -94,7 +94,7 @@ class ImageConst{
4=>self::reportPath, 4=>self::reportPath,
5=>self::memberAvatar 5=>self::memberAvatar
); );
const ninTyPath='?x-oss-process=image/resize,m_fill,h_90,w_90';
const sizeScale = 1.5; const sizeScale = 1.5;
const goodsListImgSize = 334; const goodsListImgSize = 334;
const CommentGoodsImgSize = 138; const CommentGoodsImgSize = 138;
......
...@@ -17,7 +17,8 @@ class PathConst { ...@@ -17,7 +17,8 @@ class PathConst {
const wxGoodsParams="id={0}"; const wxGoodsParams="id={0}";
//1:店铺小程序二维码生成路径,2:商品小程序二维码路径 //1:店铺小程序二维码生成路径,2:商品小程序二维码路径
const wxStorePath="pages/shops/home/index"; const wxStorePath="pages/shops/home/index";
const wxGoodsPath="pages/products/home/index"; const wxGoodsPath="pages/products/details/index";
// const wxGoodsPath="pages/goods/home/index";
//默认小程序的图片 //默认小程序的图片
const wxDefaultPath="/data/img/qrcode.jpg"; const wxDefaultPath="/data/img/qrcode.jpg";
//下载app的页面 //下载app的页面
......
...@@ -45,6 +45,7 @@ class PayConst { ...@@ -45,6 +45,7 @@ class PayConst {
const wxAppNotifyUrl = '/pay/wxAppNotify.php'; const wxAppNotifyUrl = '/pay/wxAppNotify.php';
const wxAppNotifyUrlService = '/pay/wxAppNotifyService.php';
const aliAppNotifyUrl = '/pay/aliAppNotify.php'; const aliAppNotifyUrl = '/pay/aliAppNotify.php';
const wxLiteNotifyUrl = '/pay/wxLiteNotify.php'; const wxLiteNotifyUrl = '/pay/wxLiteNotify.php';
const qPayNotifyUrl = '/pay/qPayNotify.php'; const qPayNotifyUrl = '/pay/qPayNotify.php';
......
...@@ -73,7 +73,7 @@ class WechatCommon ...@@ -73,7 +73,7 @@ class WechatCommon
} }
public function httpsPostJson($url, $data = '', $array = true) public function httpsPostJson($url, $data = '', $array = false)
{ {
$curl = curl_init($url); $curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
......
...@@ -33,7 +33,7 @@ class Pay { ...@@ -33,7 +33,7 @@ class Pay {
$orderInfo = $this->getOrder($wxFlag); $orderInfo = $this->getOrder($wxFlag);
if($data['channel'] == \Our\NameConst::wxAppChannel){ if($data['channel'] == \Our\NameConst::wxAppChannel){
$wxpay = WxPay::getInstance(); $wxpay = WxPay::getInstance();
unset($orderInfo['subMchId']); //unset($orderInfo['subMchId']);
$return = $wxpay->doPay($orderInfo); $return = $wxpay->doPay($orderInfo);
}else if($data['channel'] == \Our\NameConst::aliApiChannel){ }else if($data['channel'] == \Our\NameConst::aliApiChannel){
$alipay= Alipay::getInstance(); $alipay= Alipay::getInstance();
......
...@@ -22,6 +22,7 @@ class TencentPay { ...@@ -22,6 +22,7 @@ class TencentPay {
protected $s_appid =''; protected $s_appid ='';
protected $s_key = ''; protected $s_key = '';
protected $s_mch_id =''; protected $s_mch_id ='';
protected $s_notify_url = '';
protected $prepay_id =''; protected $prepay_id ='';
protected $tradeType = ''; protected $tradeType = '';
public $data;//接收到的数据,类型为关联数组 public $data;//接收到的数据,类型为关联数组
...@@ -79,11 +80,10 @@ class TencentPay { ...@@ -79,11 +80,10 @@ class TencentPay {
$this->parameters['sub_openid'] = $orderInfo['openid']; $this->parameters['sub_openid'] = $orderInfo['openid'];
} }
$this->parameters['spbill_create_ip']=\Our\Common::getClientIp(); $this->parameters['spbill_create_ip']=\Our\Common::getClientIp();
$this->parameters['notify_url']=$this->notify_url; $this->parameters['notify_url']=$this->s_notify_url;
$this->parameters['trade_type']= $this->tradeType; $this->parameters['trade_type']= $this->tradeType;
//$this->parameters['openid']=$_SESSION['openid']; //$this->parameters['openid']=$_SESSION['openid'];
//print_r($this->parameters);exit; //print_r($this->parameters);exit;
\Our\Log::getInstance()->write(json_encode($this->parameters),'/data/log/apptest');
$prepay_id = $this->getPrepayId(); $prepay_id = $this->getPrepayId();
$this->setPrepayId($prepay_id); $this->setPrepayId($prepay_id);
} }
...@@ -124,7 +124,6 @@ class TencentPay { ...@@ -124,7 +124,6 @@ class TencentPay {
$this->postXml($this->orderquery_url); $this->postXml($this->orderquery_url);
$this->result = $this->xmlToArray($this->response); $this->result = $this->xmlToArray($this->response);
\Our\Log::getInstance()->write(json_encode($this->result),'/data/log/apptest'); \Our\Log::getInstance()->write(json_encode($this->result),'/data/log/apptest');
\Our\Log::getInstance()->write(json_encode($this->result),'/data/log/apptest');
if($this->result['return_code']=="SUCCESS"&&$this->result['result_code']=="SUCCESS"&&$this->result['trade_state']=="SUCCESS"){ if($this->result['return_code']=="SUCCESS"&&$this->result['result_code']=="SUCCESS"&&$this->result['trade_state']=="SUCCESS"){
return true; return true;
} }
...@@ -148,9 +147,7 @@ class TencentPay { ...@@ -148,9 +147,7 @@ class TencentPay {
function postXml($url=false) function postXml($url=false)
{ {
$xml = $this->createXml(); $xml = $this->createXml();
\Our\Log::getInstance()->write($xml,'/data/log/applog');
$this->response = $this->postXmlCurl($xml,$url?$url:$this->pay_url,$this->curl_timeout); $this->response = $this->postXmlCurl($xml,$url?$url:$this->pay_url,$this->curl_timeout);
\Our\Log::getInstance()->write(serialize($this->response),'/data/log/applog');
return $this->response; return $this->response;
} }
...@@ -360,9 +357,12 @@ class TencentPay { ...@@ -360,9 +357,12 @@ class TencentPay {
/** /**
* 获取notify信息 * 获取notify信息
*/ */
public function getNotifyInfo() { public function getNotifyInfo($serviceFlag=false) {
$xml = file_get_contents("php://input"); $xml = file_get_contents("php://input");
$this->saveData($xml); $this->saveData($xml);
if($serviceFlag){
$this->key= $this->s_key;
}
$verify = false; $verify = false;
if($this->checkSign() == FALSE){ if($this->checkSign() == FALSE){
$this->setReturnParameter("return_msg","签名失败");//返回信息 $this->setReturnParameter("return_msg","签名失败");//返回信息
......
...@@ -13,6 +13,7 @@ class WxLitePay extends \Payment\TencentPay{ ...@@ -13,6 +13,7 @@ class WxLitePay extends \Payment\TencentPay{
{ {
$this->appid = \Our\PayConst::wxLiteAppId; $this->appid = \Our\PayConst::wxLiteAppId;
$this->notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxLiteNotifyUrl; $this->notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxLiteNotifyUrl;
$this->s_notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxLiteNotifyUrl;
//$this->notify_url = \Our\NameConst::httpPrefix. $_SERVER['SERVER_NAME'] .\Our\PayConst::wxLiteNotifyUrl; //$this->notify_url = \Our\NameConst::httpPrefix. $_SERVER['SERVER_NAME'] .\Our\PayConst::wxLiteNotifyUrl;
$this->mch_id = \Our\PayConst::wxPayMchId; $this->mch_id = \Our\PayConst::wxPayMchId;
$this->key = \Our\PayConst::wxSPayKey; $this->key = \Our\PayConst::wxSPayKey;
......
...@@ -15,7 +15,7 @@ class WxPay extends \Payment\TencentPay ...@@ -15,7 +15,7 @@ class WxPay extends \Payment\TencentPay
public function __construct() public function __construct()
{ {
$this->appid = \Our\PayConst::wxPayAppId; $this->appid = \Our\PayConst::wxPayAppId;
$this->notify_url = \Our\Common::getBaseUrl(). \Our\PayConst::wxAppNotifyUrl; $this->notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxAppNotifyUrl;
$this->mch_id = \Our\PayConst::wxPayMchId; $this->mch_id = \Our\PayConst::wxPayMchId;
$this->key = \Our\PayConst::wxPayKey; $this->key = \Our\PayConst::wxPayKey;
$this->sslcert_path = \Our\PayConst::wxSslcertPath; $this->sslcert_path = \Our\PayConst::wxSslcertPath;
...@@ -25,6 +25,7 @@ class WxPay extends \Payment\TencentPay ...@@ -25,6 +25,7 @@ class WxPay extends \Payment\TencentPay
$this->s_mch_id = \Our\PayConst::wxSPayMchId; $this->s_mch_id = \Our\PayConst::wxSPayMchId;
$this->s_key = \Our\PayConst::wxSPayKey; $this->s_key = \Our\PayConst::wxSPayKey;
$this->s_appid = \Our\PayConst::wxSPayAppId; $this->s_appid = \Our\PayConst::wxSPayAppId;
$this->s_notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxAppNotifyUrlService;
} }
public function doPay($orderInfo) public function doPay($orderInfo)
......
...@@ -603,7 +603,7 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -603,7 +603,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){ foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
$storeCarts = $storeCartData['cartList'][$storeId]; $storeCarts = $storeCartData['cartList'][$storeId];
$deliverySetting['onelinePay'] = $store['wx_pay'];//是否支持线上支付 $deliverySetting['onelinePay'] = $store['wx_pay']&&$store['onlinepay_flag']?\Our\ApiConst::one:\Our\ApiConst::zero;//是否支持线上支付
$deliverySetting['offlinePay'] = $store['offline_pay']; $deliverySetting['offlinePay'] = $store['offline_pay'];
if($deliverySetting['offlinePay']){ if($deliverySetting['offlinePay']){
...@@ -680,7 +680,7 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -680,7 +680,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){ foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false); $store = $storeDao->get($storeId,false);
$storeCarts = $storeCartData['cartList'][$storeId]; $storeCarts = $storeCartData['cartList'][$storeId];
$deliverySetting['onelinePay'] = $store['wx_pay'];//是否支持线上支付 $deliverySetting['onelinePay'] = $store['wx_pay']&&$store['onlinepay_flag']?\Our\ApiConst::one:\Our\ApiConst::zero;//是否支持线上支付
$deliverySetting['offlinePay'] = $store['offline_pay']; $deliverySetting['offlinePay'] = $store['offline_pay'];
$deliverySetting['offlinePayway'] = array('payway'=>'','imageUrls'=>array()); $deliverySetting['offlinePayway'] = array('payway'=>'','imageUrls'=>array());
if($deliverySetting['offlinePay']){ if($deliverySetting['offlinePay']){
......
File mode changed from 100755 to 100644
...@@ -670,9 +670,12 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -670,9 +670,12 @@ class OrderServiceModel extends \Business\AbstractModel
//更新订单信息 //更新订单信息
$updateData = array('order_state' => ApiConst::orderStateCancel,'is_effective'=>ApiConst::cancelOrderAuto); $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);
if(!$update || !$res){ // if(!$update || !$res){
// echo '订单:'.$order['orderId'].'没取消成功!';
// }
if(!$update){
echo '订单:'.$order['orderId'].'没取消成功!'; echo '订单:'.$order['orderId'].'没取消成功!';
} }
//$orderGoodsUpdateData['refund_state_name']='退款成功'; //$orderGoodsUpdateData['refund_state_name']='退款成功';
...@@ -1167,7 +1170,13 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -1167,7 +1170,13 @@ class OrderServiceModel extends \Business\AbstractModel
$paySn = $data['paySn']; $paySn = $data['paySn'];
$oldOrderPay = $orderPayModel->find(array('pay_sn'=>$paySn)); $oldOrderPay = $orderPayModel->find(array('pay_sn'=>$paySn));
$orderStateArray = array_column($orderList,'order_state'); $orderStateArray = array_column($orderList,'order_state');
\Our\Log::getInstance()->write(json_encode($orderStateArray),'/data/log/apptest');
if(isset($data['wxLitePayFlag'])&&$data['wxLitePayFlag']==\Our\ApiConst::one){//微信小程序支付时
$oldOrderPay['pay_type'] = \Our\ApiConst::wxLitePayType;
}
if(in_array(\Our\ApiConst::orderStateWaitPay,$orderStateArray)&&in_array($oldOrderPay['pay_type'],array(\Our\ApiConst::wxAppPayType,\Our\ApiConst::wxLitePayType))&&((isset($data['payFlag'])&&$data['payFlag']==\Our\ApiConst::one)||!isset($data['payFlag']))){ if(in_array(\Our\ApiConst::orderStateWaitPay,$orderStateArray)&&in_array($oldOrderPay['pay_type'],array(\Our\ApiConst::wxAppPayType,\Our\ApiConst::wxLitePayType))&&((isset($data['payFlag'])&&$data['payFlag']==\Our\ApiConst::one)||!isset($data['payFlag']))){
\Our\Log::getInstance()->write($data['payFlag'],'/data/log/apptest');
if($oldOrderPay['pay_type']==\Our\ApiConst::wxLitePayType){ if($oldOrderPay['pay_type']==\Our\ApiConst::wxLitePayType){
$wxLitePay = \Payment\WxLitePay::getInstance(); $wxLitePay = \Payment\WxLitePay::getInstance();
$storeId = $orderList[0]['store_id']; $storeId = $orderList[0]['store_id'];
...@@ -1179,7 +1188,13 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -1179,7 +1188,13 @@ class OrderServiceModel extends \Business\AbstractModel
$payResult = $wxLitePay->getOrderPayResult($paySn,$subMchId); $payResult = $wxLitePay->getOrderPayResult($paySn,$subMchId);
}else{ }else{
$wxPay = \Payment\WxPay::getInstance(); $wxPay = \Payment\WxPay::getInstance();
$payResult = $wxPay->getOrderPayResult($paySn); $storeId = $orderList[0]['store_id'];
$mchIdArray = $storeDao->getStoreWxMchId($storeId);
if($mchIdArray['errorCode']>0){
\Error\ErrorModel::throwException($mchIdArray['errorCode']);
}
$subMchId = $mchIdArray['mchId'];
$payResult = $wxPay->getOrderPayResult($paySn,$subMchId);
} }
\Our\Log::getInstance()->write('支付结果'.$payResult,'/data/log/apptest'); \Our\Log::getInstance()->write('支付结果'.$payResult,'/data/log/apptest');
if($payResult){ if($payResult){
...@@ -1249,7 +1264,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -1249,7 +1264,7 @@ class OrderServiceModel extends \Business\AbstractModel
$return['orderState'] = $orderState; $return['orderState'] = $orderState;
if(isset($data['wxLitePayFlag'])&&$data['wxLitePayFlag']==\Our\ApiConst::one){ if(isset($data['wxLitePayFlag'])&&$data['wxLitePayFlag']==\Our\ApiConst::one){
$return['paySn'] = $data['paySn']; $return['paySn'] = $data['paySn'];
if(!$orderState){ if(!$orderState&&!((isset($data['payFlag'])&&$data['payFlag']==\Our\ApiConst::one))){
$orderConfirmUtil = \Order\OrderConfirmUtil::getInstance(); $orderConfirmUtil = \Order\OrderConfirmUtil::getInstance();
$paySn = $orderConfirmUtil->makeNewPaySnForOrderWithOldPaySn($data['paySn'],$memberId); $paySn = $orderConfirmUtil->makeNewPaySnForOrderWithOldPaySn($data['paySn'],$memberId);
$return['paySn'] = $paySn; $return['paySn'] = $paySn;
......
...@@ -57,7 +57,7 @@ class PaymentServiceModel extends \Business\AbstractModel{ ...@@ -57,7 +57,7 @@ class PaymentServiceModel extends \Business\AbstractModel{
/** /**
* app微信支付回调 * app微信支付回调
*/ */
public function updateOrderToPayed($channel = \Our\NameConst::wxAppChannel){ public function updateOrderToPayed($channel = \Our\NameConst::wxAppChannel,$serviceFlag=false){
if($channel == \Our\NameConst::wxLiteChannel){ if($channel == \Our\NameConst::wxLiteChannel){
$wxpay = \Payment\WxLitePay::getInstance(); $wxpay = \Payment\WxLitePay::getInstance();
$param['pay_type'] = \Our\ApiConst::wxLitePayType; $param['pay_type'] = \Our\ApiConst::wxLitePayType;
...@@ -68,7 +68,7 @@ class PaymentServiceModel extends \Business\AbstractModel{ ...@@ -68,7 +68,7 @@ class PaymentServiceModel extends \Business\AbstractModel{
$wxpay = \Payment\WxPay::getInstance(); $wxpay = \Payment\WxPay::getInstance();
$param['pay_type'] = \Our\ApiConst::wxAppPayType; $param['pay_type'] = \Our\ApiConst::wxAppPayType;
} }
$callbackInfo = $wxpay->getNotifyInfo(); $callbackInfo = $wxpay->getNotifyInfo($serviceFlag);
if($callbackInfo) { if($callbackInfo) {
//验证成功 //验证成功
$param['paySn'] = $callbackInfo['out_trade_no']; $param['paySn'] = $callbackInfo['out_trade_no'];
......
...@@ -482,6 +482,7 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -482,6 +482,7 @@ class RefundServiceModel extends \Business\AbstractModel
$refundReturnDao->db->doRollback(); $refundReturnDao->db->doRollback();
return false; return false;
} }
//$this->recordSellerLog('退款处理,退款编号:'.$refund['refund_sn']); //待确认 //$this->recordSellerLog('退款处理,退款编号:'.$refund['refund_sn']); //待确认
//记录操作日志 //记录操作日志
$sellerLogDAO = \DAO\SellerLogModel::getInstance(); $sellerLogDAO = \DAO\SellerLogModel::getInstance();
...@@ -512,14 +513,14 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -512,14 +513,14 @@ class RefundServiceModel extends \Business\AbstractModel
'refundId'=>$refund['refund_id'])); 'refundId'=>$refund['refund_id']));
$push->addOneToClient($pushData); $push->addOneToClient($pushData);
$push->sendTcpMessage(); $push->sendTcpMessage();
return true;
}
if($refundAmount > $refund['buyer_refund_amount']){ return true;
//showDialog('退款金额不可大于本订单支付金额','','error');
$refundReturnDao->db->doRollback();
return false;
} }
// if($refundAmount > $refund['buyer_refund_amount']){
// //showDialog('退款金额不可大于本订单支付金额','','error');
// $refundReturnDao->db->doRollback();
// return false;
// }
//以下为同意退款流程 //以下为同意退款流程
if($order_info['order_state']==40){ //交易完成订单,退积分 if($order_info['order_state']==40){ //交易完成订单,退积分
...@@ -1001,7 +1002,8 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1001,7 +1002,8 @@ class RefundServiceModel extends \Business\AbstractModel
// $shippingTypes = ArrayConst::refundShippingType[$orderInfo['shippingType']]; // $shippingTypes = ArrayConst::refundShippingType[$orderInfo['shippingType']];
//获得订单商品 //获得订单商品
$orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance(); $orderGoodsDao = \DAO\Order\OrderGoodsModel::getInstance();
$orderGoodses = \Our\RedisHelper::cachedFunction(\Redis\Db5\RefundReasonRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByOrderIds'), array($orderInfo['orderId'], $this->orderGoodsField), \Our\ApiConst::oneDaySecond); $orderGoodses =$orderGoodsDao->getOrderGoodsByOrderIds($orderInfo['orderId'], $this->orderGoodsField);
//\Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByOrderIds'), array($orderInfo['orderId'], $this->orderGoodsField), \Our\ApiConst::oneDaySecond);
$orderGoodses = $orderGoodsDao->convertOrderGoods($orderGoodses, 'goodsId'); $orderGoodses = $orderGoodsDao->convertOrderGoods($orderGoodses, 'goodsId');
$allOrderGoods=$orderGoodses; $allOrderGoods=$orderGoodses;
$goodsIds = $orderGoodsDao->getRefundOrderGoodsIds($orderGoodses); $goodsIds = $orderGoodsDao->getRefundOrderGoodsIds($orderGoodses);
...@@ -1013,19 +1015,20 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1013,19 +1015,20 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoods = $orderGoodses[$goodsId]; $orderGoods = $orderGoodses[$goodsId];
} }
if (!empty($orderGoods)) { if (!empty($orderGoods)) {
array_push($goodsIds, $goodsId); array_push($goodsIds, (int)$goodsId);
}else{ }else{
ErrorModel::throwException(CodeConfigModel::notExistOrderGoods); ErrorModel::throwException(CodeConfigModel::notExistOrderGoods);
} }
$shippingFee = ApiConst::zero; $shippingFee = ApiConst::zero;
$allReadyGoodsCount=count($goodsIds); $allReadyGoodsCount=count($goodsIds);
$allGoodsCount=count($orderGoodses); $allGoodsCount=count($orderGoodses);
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero; $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
if($allReadyGoodsCount==ApiConst::one){ // if($allReadyGoodsCount==ApiConst::one){
$shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero; // $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
}else{ // }else{
$shippingFee == ApiConst::zero; // $shippingFee == ApiConst::zero;
} // }
// if (count($orderGoods) == ApiConst::one) { // if (count($orderGoods) == ApiConst::one) {
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero; // $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// } else { // } else {
...@@ -1055,7 +1058,6 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1055,7 +1058,6 @@ class RefundServiceModel extends \Business\AbstractModel
if ($orderInfo['paymentTime']) { if ($orderInfo['paymentTime']) {
$orderConfirmUtil = \Order\OrderConfirmUtil::getInstance(); $orderConfirmUtil = \Order\OrderConfirmUtil::getInstance();
if ($orderInfo['couponId']) { if ($orderInfo['couponId']) {
if ($refundCondition) { if ($refundCondition) {
$refundCondition['storeCarts']['storeCarts'] = $cartDao->refundGoodsRemove($refundCondition['storeCarts']['storeCarts'], $goodsIds); $refundCondition['storeCarts']['storeCarts'] = $cartDao->refundGoodsRemove($refundCondition['storeCarts']['storeCarts'], $goodsIds);
...@@ -1070,45 +1072,33 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1070,45 +1072,33 @@ class RefundServiceModel extends \Business\AbstractModel
// if(!$alreadyRefundGoodsIds){ // if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount; // $refundAmount=$refundAmount-$discountAmount;
// } // }
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
} else { } else {
$refundAmount = $orderGoods['goodsPrice']*$orderGoods['goodsNum']; $refundAmount = $orderGoods['goodsPrice']*$orderGoods['goodsNum'];
// if(!$alreadyRefundGoodsIds){ if($allReadyGoodsCount==ApiConst::one){
// $refundAmount=$refundAmount-$discountAmount;
// }
}
if($allReadyGoodsCount==ApiConst::one){
if($orderInfo['couponId']){
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
}else{
$refundAmount=$refundAmount+$orderInfo['shippingFee']; $refundAmount=$refundAmount+$orderInfo['shippingFee'];
if($shippingFee){ if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee']; $refundAmount=$refundAmount-$orderInfo['shippingFee'];
} }
} }
// if($shippingFee && ($orderInfo['shippingType']==ApiConst::bySeller)){ //修改后的优惠金额按比例退回
// $refundAmount=$refundAmount-$orderInfo['shippingFee']; $discountAmount=$orderInfo['originAmount']- $orderInfo['orderAmount'];
// } $mustReduceAmount=ApiConst::zero;
}else{ if($discountAmount){
if($orderInfo['couponId']){ $orderGoodsConvertes=array();
if($shippingFee){ array_push($orderGoodsConvertes,$orderGoodsConvert);
$refundAmount=$refundAmount-$orderInfo['shippingFee']; $mustReduceAmount=$orderGoodsDao->getMustReduceAmount($allOrderGoods,$discountAmount,$orderGoodsConvertes);
}
} }
}
//修改后的优惠金额按比例退回
$discountAmount=$orderInfo['originAmount']- $orderInfo['orderAmount'];
$mustReduceAmount=ApiConst::zero;
if($discountAmount){
$mustReduceAmount=$orderGoodsDao->getMustReduceAmount($allOrderGoods,$discountAmount,$orderGoodsConvert);
}
if(!$orderInfo['couponId']){
$refundAmount=$refundAmount-$mustReduceAmount; $refundAmount=$refundAmount-$mustReduceAmount;
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
} }
//配送订单配送费按比例收取 //配送订单配送费按比例收取
// if($orderInfo['shippingType']==ApiConst::bySeller){ // if($orderInfo['shippingType']==ApiConst::bySeller){
// $mustSheepingFee=ApiConst::zero; // $mustSheepingFee=ApiConst::zero;
...@@ -1267,10 +1257,12 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1267,10 +1257,12 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArray['add_time'] = TIMESTAMP; $refundArray['add_time'] = TIMESTAMP;
$refundArray['refund_type']=$refund['refundType']; $refundArray['refund_type']=$refund['refundType'];
$refundArray['refund_shipping_type']=isset($refund['refundShippingType'])?$refund['refundShippingType']:ApiConst::zero; $refundArray['refund_shipping_type']=isset($refund['refundShippingType'])?$refund['refundShippingType']:ApiConst::zero;
$refundArray['payment_type']=$orderInfo['paymentType'];
$refundArrayUnLine=Common::convertUnderline($refundArray); $refundArrayUnLine=Common::convertUnderline($refundArray);
$state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods); $state = $refundReturnDao->addRefundReturn($refundArray,$orderInfo,$orderGoods);
$updateOrderData['refund_amount']= $orderInfo['refundAmount']+ $refundArray['refund_amount'];
$updateOrderData['origin_refund_amount']= $orderInfo['origin_refund_amount']+$originRefundAmount; $updateOrderData['refund_amount']= $orderInfo['refundAmount']+ $refundAmount;
$updateOrderData['origin_refund_amount']= $orderInfo['originRefundAmount']+$originRefundAmount;
$orderDao->deleteOrderCache($memberId,$orderInfo['orderId'],$orderInfo['storeId'],true); $orderDao->deleteOrderCache($memberId,$orderInfo['orderId'],$orderInfo['storeId'],true);
$storeDao->deleteStoreCache($orderInfo['storeId'],$orderInfo['orderId']); $storeDao->deleteStoreCache($orderInfo['storeId'],$orderInfo['orderId']);
......
...@@ -76,7 +76,7 @@ class DeliveryServiceModel extends \Business\AbstractModel ...@@ -76,7 +76,7 @@ class DeliveryServiceModel extends \Business\AbstractModel
$qmDeliveryManLogData['distribution_fee'] =$data['distributionFee']; $qmDeliveryManLogData['distribution_fee'] =$data['distributionFee'];
$qmDeliveryManLogData['order_type'] = $data['orderType']; $qmDeliveryManLogData['order_type'] = $data['orderType'];
if($data['orderType']==ApiConst::orderTypeRefund){ if($data['orderType']==ApiConst::orderTypeRefund){
$qmDeliveryManLogData['shipping_fee']=$orderD['need_shipping_fee']; $qmDeliveryManLogData['shipping_fee']=$orderD['needShippingFee'];
}else{ }else{
$qmDeliveryManLogData['shipping_fee'] = $orderD['shippingFee']; $qmDeliveryManLogData['shipping_fee'] = $orderD['shippingFee'];
} }
......
...@@ -213,14 +213,9 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -213,14 +213,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeMember['fav_type'] = \Our\ApiConst::one; $storeMember['fav_type'] = \Our\ApiConst::one;
$storeMembers[] = $storeMember; $storeMembers[] = $storeMember;
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance(); $favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$one = $favoritesStoreDao->getOne('store_id',array('store_id'=>$storeId,'member_id'=>$memberId,'fav_type'=>\Our\ApiConst::one,'fav_from'=>\Our\ApiConst::scanFavor),''); $result = $favoritesStoreDao->insertAll($storeMembers);
if(!$one) { if($result) {
$result = $favoritesStoreDao->insertAll($storeMembers); $favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
if($result) {
$favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
}
$favoritesDao = \DAO\FavoritesStoreModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$favoritesDao, 'getOne'),array(),array($memberId));
} }
}else{ }else{
......
...@@ -376,8 +376,6 @@ class MemberServiceModel extends \Business\AbstractModel ...@@ -376,8 +376,6 @@ class MemberServiceModel extends \Business\AbstractModel
return false; return false;
} }
$favoritesStoreDao->updateStoreCollecitonsCache($storeIds,$memberId,2); $favoritesStoreDao->updateStoreCollecitonsCache($storeIds,$memberId,2);
$favoritesDao = \DAO\FavoritesStoreModel::getInstance();
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$favoritesDao, 'getOne'),array(),array($memberId));
} }
} }
...@@ -1128,7 +1126,7 @@ class MemberServiceModel extends \Business\AbstractModel ...@@ -1128,7 +1126,7 @@ class MemberServiceModel extends \Business\AbstractModel
public function updateMemberAreaInfo(){ public function updateMemberAreaInfo(){
$currentTime = TIMESTAMP; $currentTime = TIMESTAMP;
$startTime = $currentTime-\Our\ApiConst::oneDaySecond; $startTime = $currentTime-\Our\ApiConst::oneDaySecond;
if($currentTime<1545235200){ if($currentTime<1546272000){
$startTime =0; $startTime =0;
} }
$whereSql = \Our\Common::format("member_provinceid = '0' and member_cityid = '0' and register_ip !='' and (member_time between '{0}' and '{1}') ",$startTime,$currentTime); $whereSql = \Our\Common::format("member_provinceid = '0' and member_cityid = '0' and register_ip !='' and (member_time between '{0}' and '{1}') ",$startTime,$currentTime);
......
...@@ -79,7 +79,7 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -79,7 +79,7 @@ class ShareServiceModel extends \Business\AbstractModel
} }
public function saveDataToSession($data){ public function saveDataToSession($data){
$this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance(); $this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
$res= $this->memberDb0Redis->tablerpush($data['key'],json_encode($data)); $res= $this->memberDb0Redis->tableCacheSet($data['key'],json_encode($data),ApiConst::oneDaySecond);
return $res; return $res;
} }
//二进制转图片image/png //二进制转图片image/png
...@@ -111,6 +111,12 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -111,6 +111,12 @@ class ShareServiceModel extends \Business\AbstractModel
return Common::format(PathConst::shareGroups,$data['groupId'],$data['storeId']); return Common::format(PathConst::shareGroups,$data['groupId'],$data['storeId']);
} }
if($type='smallPrograme'){
$host=\Bootstrap::getUrlIniConfig('resourcesHost');
$url=Common::format($host."/index/getQrcodeFlow?imageKey={0}",$data);
return $url;
}
} }
public function growQrcode($data){ public function growQrcode($data){
...@@ -121,12 +127,21 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -121,12 +127,21 @@ class ShareServiceModel extends \Business\AbstractModel
$scene= \Our\Common::format(\Our\PathConst::wxStoreParams,$data['id']); $scene= \Our\Common::format(\Our\PathConst::wxStoreParams,$data['id']);
$page=\Our\PathConst::wxStorePath; $page=\Our\PathConst::wxStorePath;
$res=$this->getQrcode($page,$scene); $res=$this->getQrcode($page,$scene);
$fileName=md5($page.$res); if(Common::isJson($res)){
$fileName=$fileName.NameConst::jpgSuffix; $res=json_decode($res,true);
$base64image=$this->dataUri($res,ImageConst::imagePgn); if($res['errcode']==ApiConst::shareLimitProgrameError){
$url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName); $memberRedis = \Redis\Db0\MemberRedisModel::getInstance();
$this->memberDb0Redis->tableCacheSet($fileName,$url,ApiConst::zero); $memberRedis->tableDel('wechatAccessToken');
return $url; $res=$this->getQrcode($page,$scene);
}
}
$fileName=md5($res);
//$fileName=$fileName.NameConst::jpgSuffix;
// $base64image=$this->dataUri($res,ImageConst::imagePgn);
// $url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this->memberDb0Redis->tableCacheSet($fileName,$res,ApiConst::oneDaySecond);
$qrcodeUrl=$this->getQrUrl($fileName,'smallPrograme');
return $qrcodeUrl;
}else{ }else{
return $this->getQrUrl($data); return $this->getQrUrl($data);
// return PathConst::wxDefaultPath; // return PathConst::wxDefaultPath;
...@@ -140,15 +155,28 @@ class ShareServiceModel extends \Business\AbstractModel ...@@ -140,15 +155,28 @@ class ShareServiceModel extends \Business\AbstractModel
if($data['type']==\Our\ApiConst::shareGoods){ if($data['type']==\Our\ApiConst::shareGoods){
if(($data['shareType']==ApiConst::shareWxFriend || $data['shareType']==ApiConst::shareWxFriends)){ if(($data['shareType']==ApiConst::shareWxFriend || $data['shareType']==ApiConst::shareWxFriends)){
if(\Our\ApiConst::isWxPublish){ if(\Our\ApiConst::isWxPublish){
$scene= \Our\Common::format(\Our\PathConst::wxGoodsParams,$data['id']); //$scene= \Our\Common::format(\Our\PathConst::wxGoodsParams,$data['id']);
$scene= \Our\Common::format(\Our\PathConst::wxGoodsParams,$data['goodsCommonid']);
$page=\Our\PathConst::wxGoodsPath; $page=\Our\PathConst::wxGoodsPath;
$res=$this->getQrcode($page,$scene); $res=$this->getQrcode($page,$scene);
$fileName=md5($page.$res); if(Common::isJson($res)){
$fileName=$fileName.NameConst::jpgSuffix; $res=json_decode($res,true);
$base64image=$this->dataUri($res,ImageConst::imagePgn); if($res['errcode']==ApiConst::shareLimitProgrameError){
$url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName); $memberRedis = \Redis\Db0\MemberRedisModel::getInstance();
$this->memberDb0Redis->tableCacheSet($fileName,$url,ApiConst::zero); $memberRedis->tableDel('wechatAccessToken');
return $url; $res=$this->getQrcode($page,$scene);
}
}
// var_dump($res);exit;
// header('Content-type: image/jpg');
// echo $res;exit;
$fileName=md5($res);
//$fileName=$fileName.NameConst::jpgSuffix;
// $base64image=$this->dataUri($res,ImageConst::imagePgn);
// $url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this->memberDb0Redis->tableCacheSet($fileName,$res,ApiConst::oneDaySecond);
$qrcodeUrl=$this->getQrUrl($fileName,'smallPrograme');
return $qrcodeUrl;
}else{ }else{
return $this->getQrUrl($data,'goods'); return $this->getQrUrl($data,'goods');
//return PathConst::wxDefaultPath; //return PathConst::wxDefaultPath;
......
...@@ -75,6 +75,7 @@ abstract class AbstractModel { ...@@ -75,6 +75,7 @@ abstract class AbstractModel {
public function lists($where=array(),$order='',$field='*',$pageIndex=0,$pageSize=20,$group = null){ public function lists($where=array(),$order='',$field='*',$pageIndex=0,$pageSize=20,$group = null){
$this->db->from($this->_tableName); $this->db->from($this->_tableName);
$this->db->where($where); $this->db->where($where);
$this->db->select($field);
$count=$this->db->fetchNum(); $count=$this->db->fetchNum();
$this->db->from($this->_tableName); $this->db->from($this->_tableName);
$this->db->where($where); $this->db->where($where);
......
...@@ -38,10 +38,6 @@ class ArticleModel extends \DAO\AbstractModel{ ...@@ -38,10 +38,6 @@ class ArticleModel extends \DAO\AbstractModel{
return $data; return $data;
} }
public function findFromCache($where,$field= \Our\NameConst::allField){
}
public function getList($where,$field = \Our\NameConst::allField,$order = null){ public function getList($where,$field = \Our\NameConst::allField,$order = null){
$this->setDb($this->dbName); $this->setDb($this->dbName);
if(is_array($where)){ if(is_array($where)){
...@@ -57,6 +53,16 @@ class ArticleModel extends \DAO\AbstractModel{ ...@@ -57,6 +53,16 @@ class ArticleModel extends \DAO\AbstractModel{
return $result; return $result;
} }
public function delArtcileCache($articleClassId = false,$articleId = false){
if($articleClassId){
\Our\RedisHelper::cachedFunction(\Redis\Db10\ArticleRedisModel::getInstance(),array(&$this, 'getList'),array(),array($articleClassId));
}
if($articleId){
\Our\RedisHelper::cachedFunction(\Redis\Db10\ArticleRedisModel::getInstance(),array(&$this, 'find'),array(),array($articleId));
}
}
/** /**
* 类实例 * 类实例
*/ */
......
...@@ -271,18 +271,23 @@ class CartModel extends \DAO\AbstractModel{ ...@@ -271,18 +271,23 @@ class CartModel extends \DAO\AbstractModel{
return false; return false;
} }
public function refundGoodsRemove($storeCarts,$goodsIds){ public function refundGoodsRemove($storeCarts,$goodsIds){
for($i=0;$i<count($storeCarts);$i++){ $newStoreCarts= array();
if(is_array($goodsIds)){
if(in_array($storeCarts[$i]['goodsId'],$goodsIds)){ foreach($storeCarts as $val){
unset($storeCarts[$i]); if(is_array($goodsIds)){
} if(!in_array($val['goodsId'],$goodsIds)){
}else{ array_push($newStoreCarts,$val);
if($storeCarts[$i]['goodsId']==$goodsIds){ // unset($storeCarts[$i]);
unset($storeCarts[$i]); }
}else{
if($val['goodsId']!=$goodsIds){
array_push($newStoreCarts,$val);
}
} }
} }
} return $newStoreCarts;
return $storeCarts;
} }
public function insertAllOrUpdate($datas){ public function insertAllOrUpdate($datas){
......
...@@ -205,6 +205,8 @@ class FavoritesStoreModel extends \DAO\AbstractModel { ...@@ -205,6 +205,8 @@ class FavoritesStoreModel extends \DAO\AbstractModel {
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getOne'),array(),array($memberId)); \Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getOne'),array(),array($memberId));
} }
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getFavoritesStores'),array(),array($memberId)); \Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(),array(&$this, 'getFavoritesStores'),array(),array($memberId));
\Our\RedisHelper::delCachedFunction(\Redis\Db6\FavoritesStoreRedisModel::getInstance(), array(&$this, 'selectList'), array(),array($memberId));
//更新个人中心首页数量 //更新个人中心首页数量
\DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::storeCollection,$memberId,$type == 1 ? -(count($storeIds)) : count($storeIds)); \DAO\MemberModel::getInstance()->_changeNum(\Our\NameConst::storeCollection,$memberId,$type == 1 ? -(count($storeIds)) : count($storeIds));
return true; return true;
......
...@@ -240,8 +240,15 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -240,8 +240,15 @@ class GoodsModel extends \DAO\AbstractModel {
if($op==\Our\ApiConst::plus){ if($op==\Our\ApiConst::plus){
$updateGoodsNum = -$updateGoodsNum; $updateGoodsNum = -$updateGoodsNum;
} }
if($goodsCommonRedis->tableHExists($onlineGoodsCommonSaleNumKey,$goodsCommonId)){ if($goodsCommonRedis->tableHExists($onlineGoodsCommonSaleNumKey,$goodsCommonId)){
$goodsCommonRedis->tableHIncrBy($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum); $oldSaleNum = $goodsCommonRedis->tableHGet($onlineGoodsCommonSaleNumKey,$goodsCommonId);
if($op==\Our\ApiConst::plus&&($oldSaleNum+$updateGoodsNum)<\Our\ApiConst::zero){
$updateGoodsNum = \Our\ApiConst::zero;
$goodsCommonRedis->tableHSet($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum);
}else{
$goodsCommonRedis->tableHIncrBy($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum);
}
} }
} }
\DAO\PBundlingModel::getInstance()->deletePBundlingByGoodsCommonId($goodsCommonId); \DAO\PBundlingModel::getInstance()->deletePBundlingByGoodsCommonId($goodsCommonId);
......
...@@ -107,6 +107,7 @@ class DiliverymanModel extends \DAO\AbstractModel ...@@ -107,6 +107,7 @@ class DiliverymanModel extends \DAO\AbstractModel
} }
public function getDeliveryManByStoreId($storeId){ public function getDeliveryManByStoreId($storeId){
$where['store_id']=$storeId; $where['store_id']=$storeId;
$where['is_del']=ApiConst::zero;
return $this->getByWhere($where); return $this->getByWhere($where);
} }
......
...@@ -45,7 +45,7 @@ class OrderModel extends \DAO\AbstractModel ...@@ -45,7 +45,7 @@ class OrderModel extends \DAO\AbstractModel
public function getOrderDetailField() public function getOrderDetailField()
{ {
return 'order_id as orderId,coupon_id as couponId,refund_amount as refundAmount,origin_amount as originAmount,order_sn as orderSn,pay_sn as paySn,store_name as storeName,add_time as addTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,payment_time as paymentTime,finnshed_time as finnshedTime,need_shipping_fee as needShippingFee,payment_code as paymentCode,buyer_id as buyerId,buyer_name as buyerName,refund_condition as refundCondition,delay_time as delayTime,gmt_update as gmtUpdate,diliveryman_id as diliverymanId,shipping_arrival_time as shippingArrivalTime,delivery_time as deliveryTime,order_note as orderNote,send_time as sendTime'; return 'order_id as orderId,coupon_id as couponId,refund_amount as refundAmount,origin_amount as originAmount,order_sn as orderSn,pay_sn as paySn,store_name as storeName,add_time as addTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,payment_time as paymentTime,finnshed_time as finnshedTime,need_shipping_fee as needShippingFee,payment_code as paymentCode,buyer_id as buyerId,buyer_name as buyerName,refund_condition as refundCondition,delay_time as delayTime,gmt_update as gmtUpdate,diliveryman_id as diliverymanId,shipping_arrival_time as shippingArrivalTime,delivery_time as deliveryTime,order_note as orderNote,send_time as sendTime,origin_refund_amount as originRefundAmount';
} }
public function getOrderShippingField() public function getOrderShippingField()
...@@ -478,20 +478,30 @@ class OrderModel extends \DAO\AbstractModel ...@@ -478,20 +478,30 @@ class OrderModel extends \DAO\AbstractModel
} }
public function getOrderOrderTotalOnlineByStoreId($storeId,$today=false){ public function getOrderOrderTotalOnlineByStoreId($storeId,$today=false){
$this->setDb($this->dbName); $this->setDb($this->dbName);
$refundReturnDao=\DAO\Order\RefundReturnModel::getInstance();
$where['store_id']=$storeId; $where['store_id']=$storeId;
$where['order_state']=array('notin',ArrayConst::orderCloseAndCancel); $where['order_state']=array('notin',ArrayConst::orderCloseAndCancel);
$where['refund_state']=array('neq',ApiConst::refundStateAll); // $where['refund_state']=array('neq',ApiConst::refundStateAll);
$where['payment_type']=array('in',ArrayConst::payTypeOnlines); $where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
if($today){ if($today){
$todayBegin=Common::getTodayBeginTimpSpan(); $todayBegin=Common::getTodayBeginTimpSpan();
$where['gmt_update']=array('egt',$todayBegin); $where['gmt_update']=array('between',$todayBegin,TIMESTAMP);
$where['gmt_update']=array('elt',TIMESTAMP); // $where['gmt_update']=array('elt',TIMESTAMP);
} }
if(is_array($where)){ if(is_array($where)){
$where= $this->db->getSqlWhereByArray($where); $where= $this->db->getSqlWhereByArray($where);
} }
if($today){
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(order_amount-refund_amount) as orderTotalOnline")->fetchOne(); $refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId,$today,true);
}else{
$refundAmount= $refundReturnDao->getSumRefundAmountByStoreId($storeId,false,true);
}
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,order_amount as orderTotalOnline")->fetchOne();
if(!$res){
$res=array();
$res['orderTotalOnline']=ApiConst::zero;
$res['orderTotalOnline']-=$refundAmount;
}
return $res?$res:array(); return $res?$res:array();
} }
......
...@@ -37,7 +37,16 @@ class OrderGoodsModel extends \DAO\AbstractModel ...@@ -37,7 +37,16 @@ class OrderGoodsModel extends \DAO\AbstractModel
{ {
} }
public function getCountByWhere($where){
$this->setDb($this->dbName);
$goodsCount = $this->db->select("count(*) as cou")->from($this->_tableName)->where($where)->fetchNum();
return $goodsCount?$goodsCount:ApiConst::zero;
}
public function getCountByOrderId($orderId){
$this->setDb($this->dbName);
$where['order_id']=$orderId;
return $this->getCountByWhere($where);
}
public function getOrderGoodsList($where, $field, $group = null, $limit = []) public function getOrderGoodsList($where, $field, $group = null, $limit = [])
{ {
$this->setDb(); $this->setDb();
...@@ -179,12 +188,17 @@ class OrderGoodsModel extends \DAO\AbstractModel ...@@ -179,12 +188,17 @@ class OrderGoodsModel extends \DAO\AbstractModel
{ {
$newOrderGoods = array(); $newOrderGoods = array();
$orderGoods = array_values($orderGoods); $orderGoods = array_values($orderGoods);
for ($i = ApiConst::zero; $i < count($orderGoods); $i++) { foreach($orderGoods as $orderGood){
if ($orderGoods[$i]['refundId'] != ApiConst::zero) { if($orderGood['refundId']!=ApiConst::zero){
array_push($newOrderGoods, $orderGoods); array_push($newOrderGoods, $orderGood);
// unset($orderGoods[$i]);
} }
} }
// for ($i = ApiConst::zero; $i < count($orderGoods); $i++) {
// if ($orderGoods[$i]['refundId'] != ApiConst::zero) {
// array_push($newOrderGoods, $orderGoods);
// // unset($orderGoods[$i]);
// }
// }
$goodsIds = array_column($newOrderGoods, 'goodsId'); $goodsIds = array_column($newOrderGoods, 'goodsId');
return $goodsIds; return $goodsIds;
} }
...@@ -241,7 +255,11 @@ class OrderGoodsModel extends \DAO\AbstractModel ...@@ -241,7 +255,11 @@ class OrderGoodsModel extends \DAO\AbstractModel
// $allGoodsPrice = array_column($orderGoodses, 'goodsPrice'); // $allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
// $allGoodsPrice=array_sum($allGoodsPrice); // $allGoodsPrice=array_sum($allGoodsPrice);
// $allMoney = $allNumbers * $allGoodsPrice; // $allMoney = $allNumbers * $allGoodsPrice;
$thisOrderGoodsAmount = $convertOrderGoods['goodsNum'] * $convertOrderGoods['goodsPrice']; $thisOrderGoodsAmount=ApiConst::zero;
foreach($convertOrderGoods as $convertOrderGood){
$thisOrderGoodsAmount += $convertOrderGood['goodsNum'] * $convertOrderGood['goodsPrice'];
}
$reduceAmount=($discountAmount*$thisOrderGoodsAmount)/($allMoney); $reduceAmount=($discountAmount*$thisOrderGoodsAmount)/($allMoney);
return round($reduceAmount); return round($reduceAmount);
......
...@@ -7,6 +7,7 @@ use Error\CodeConfigModel; ...@@ -7,6 +7,7 @@ use Error\CodeConfigModel;
use Error\ErrorModel; use Error\ErrorModel;
use OSS\Common; use OSS\Common;
use Our\ApiConst; use Our\ApiConst;
use Our\ArrayConst;
use Our\DbNameConst; use Our\DbNameConst;
use Our\DescribeConst; use Our\DescribeConst;
use Our\ImageConst; use Our\ImageConst;
...@@ -43,8 +44,8 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -43,8 +44,8 @@ class RefundReturnModel extends \DAO\AbstractModel
public function getCount($where) public function getCount($where)
{ {
$this->setDb(); $this->setDb($this->dbName);
return $this->db->from($this->_tableName)->where($where)->fetchNum(); return $this->db->from($this->_tableName)->where($where)->select()->fetchNum();
} }
public function getAll($where, $field, $db = DbNameConst::salveDBConnectName) public function getAll($where, $field, $db = DbNameConst::salveDBConnectName)
...@@ -55,13 +56,26 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -55,13 +56,26 @@ class RefundReturnModel extends \DAO\AbstractModel
} }
public function getRefundSuccessMoneyByStoreId($storeId, $beginTime = false, $endTime = false) public function getRefundSuccessMoneyByStoreId($storeId, $beginTime = false, $endTime = false,$online=false)
{ {
$this->setDb($this->dbName); $this->setDb($this->dbName);
if ($beginTime) { if ($beginTime) {
$where = \Our\Common::format(" store_id={0} and is_suc_refund={1} and gmt_update between {2} and {3}", $storeId, ApiConst::refundSuccess, $beginTime, $endTime); $where['store_id']=$storeId;
$where['is_suc_refund']=ApiConst::refundSuccess;
if($online){
$where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
}
$where['gmt_update']=array('between',$beginTime,$endTime);
} else { } else {
$where = \Our\Common::format(" store_id={0} and is_suc_refund={1}", $storeId, ApiConst::refundSuccess); $where['store_id']=$storeId;
$where['is_suc_refund']=ApiConst::refundSuccess;
if($online){
$where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
}
//$where = \Our\Common::format(" store_id={0} and is_suc_refund={1}", $storeId, ApiConst::refundSuccess);
}
if(is_array($where)){
$where = $this->db->getSqlWhereByArray($where);
} }
$res = $this->db->from($this->_tableName)->select($this->sumRefundAmount)->where($where)->fetchValue(); $res = $this->db->from($this->_tableName)->select($this->sumRefundAmount)->where($where)->fetchValue();
return !empty($res) ? $res : ApiConst::zero; return !empty($res) ? $res : ApiConst::zero;
...@@ -384,6 +398,7 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -384,6 +398,7 @@ class RefundReturnModel extends \DAO\AbstractModel
if ($pics) { if ($pics) {
foreach ($pics as $pic) { foreach ($pics as $pic) {
$readFile = \Our\Common::getStaticFile($pic, ImageConst::refund); $readFile = \Our\Common::getStaticFile($pic, ImageConst::refund);
//$readFile.=ImageConst::ninTyPath;
array_push($picsRes, $readFile); array_push($picsRes, $readFile);
} }
} }
...@@ -414,7 +429,7 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -414,7 +429,7 @@ class RefundReturnModel extends \DAO\AbstractModel
} }
if (intval($orderInfo['payment_type']) == ApiConst::wxAppPayType) { if (intval($orderInfo['payment_type']) == ApiConst::wxAppPayType) {
$wxpay = \Payment\WxPay::getInstance(); $wxpay = \Payment\WxPay::getInstance();
unset($param['subMchId']); //unset($param['subMchId']);
$refund_return = $wxpay->refund($param); $refund_return = $wxpay->refund($param);
$this->errorMessage = "微信返回:" . json_encode($refund_return); $this->errorMessage = "微信返回:" . json_encode($refund_return);
if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) { if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) {
...@@ -469,7 +484,7 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -469,7 +484,7 @@ class RefundReturnModel extends \DAO\AbstractModel
} }
if (intval($orderInfo['paymentType']) == ApiConst::wxAppPayType) { if (intval($orderInfo['paymentType']) == ApiConst::wxAppPayType) {
$wxpay = \Payment\WxPay::getInstance(); $wxpay = \Payment\WxPay::getInstance();
unset($param['subMchId']); //unset($param['subMchId']);
$refund_return = $wxpay->refund($param); $refund_return = $wxpay->refund($param);
$this->errorMessage = "微信返回:" . json_encode($refund_return); $this->errorMessage = "微信返回:" . json_encode($refund_return);
if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) { if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) {
...@@ -727,6 +742,18 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -727,6 +742,18 @@ class RefundReturnModel extends \DAO\AbstractModel
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundAmount")->fetchOne(); $res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundAmount")->fetchOne();
return $res?$res:array(); return $res?$res:array();
} }
public function getSumRefundAmountByStoreId($storeId,$today=false,$isOnline=false){
$this->setDb($this->dbName);
if($today){
$todayBegin=\Our\Common::getTodayBeginTimpSpan();
$res=$this->getRefundSuccessMoneyByStoreId($storeId,$todayBegin,TIMESTAMP,$isOnline);
}else{
$res=$this->getRefundSuccessMoneyByStoreId($storeId,false,false,$isOnline);
}
return $res?$res:ApiConst::zero;
}
/** /**
* @param $storeId * @param $storeId
* @param $orderState * @param $orderState
......
...@@ -300,10 +300,17 @@ class StoreModel extends \DAO\AbstractModel ...@@ -300,10 +300,17 @@ class StoreModel extends \DAO\AbstractModel
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance(); $favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$orderDao=\DAO\Order\OrderModel::getInstance(); $orderDao=\DAO\Order\OrderModel::getInstance();
$storeStatisticsDao=\DAO\StoreStatisticsModel::getInstance(); $storeStatisticsDao=\DAO\StoreStatisticsModel::getInstance();
$storeMemberStaticDao=\DAO\StoreMemberStatisticsModel::getInstance();
$favoritesStoreDao->deleteGetFavoritesCountByStoreId($storeId); $favoritesStoreDao->deleteGetFavoritesCountByStoreId($storeId);
$memberFavoritesStoreStoreMemberStatisticsDao = \DAO\Store\MemberFavoritesStoreStoreMemberStatisticsModel::getInstance(); $memberFavoritesStoreStoreMemberStatisticsDao = \DAO\Store\MemberFavoritesStoreStoreMemberStatisticsModel::getInstance();
$memberFavoritesStoreStoreMemberStatisticsDao->deleteGetGoodsCountOrderTotalByStoreIdCache($storeId); $memberFavoritesStoreStoreMemberStatisticsDao->deleteGetGoodsCountOrderTotalByStoreIdCache($storeId);
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeMemberStaticDao, 'getGoodsCountOrderTotalByStoreId'), array(), array($storeId));
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$memberFavoritesStoreStoreMemberStatisticsDao, 'getGoodsCountOrderTotalByStoreId'), array(), array($storeId));
\Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderDao, 'getShopKeeperCountByStoreId'), array(), array($storeId));
\Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeStatisticsDao, 'getByStoreId'), array(), array($storeId));;
\Our\RedisHelper::delCachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$favoritesStoreDao, 'getFavoritesCountByStoreId'), array(), array($storeId));
$orderDao->deleteGetOrderOrderTotalOnlineByStoreIdCache($storeId); $orderDao->deleteGetOrderOrderTotalOnlineByStoreIdCache($storeId);
// \Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeStatisticsDao, 'getByStoreId'), array($storeId), array($storeId));;
$storeStatisticsDao->deleteGetByStoreIdCache($storeId); $storeStatisticsDao->deleteGetByStoreIdCache($storeId);
} }
...@@ -608,7 +615,7 @@ class StoreModel extends \DAO\AbstractModel ...@@ -608,7 +615,7 @@ class StoreModel extends \DAO\AbstractModel
$mchId = ''; $mchId = '';
if($store['wx_pay']){ if($store['wx_pay']){
if(!($store['wxpay_mchid']&&$store['onlinepay_flag'])){ if(!($store['wxpay_mchid']&&$store['onlinepay_flag'])){
$errorCode = \Error\CodeConfigModel::orderWxPayError;; $errorCode = \Error\CodeConfigModel::orderWxPayError;
} }
$addKey=\Our\Common::getConfig('password.key'); $addKey=\Our\Common::getConfig('password.key');
if ($store['wxpay_mchid_sign'] == md5($store['gmt_create'].$store['wxpay_mchid'].$addKey)) { if ($store['wxpay_mchid_sign'] == md5($store['gmt_create'].$store['wxpay_mchid'].$addKey)) {
......
...@@ -44,7 +44,7 @@ class DeliveryController extends \Our\Controller_AbstractClient { ...@@ -44,7 +44,7 @@ class DeliveryController extends \Our\Controller_AbstractClient {
* 获得配送员列表 * 获得配送员列表
*/ */
public function getDeliveriersAction(){ public function getDeliveriersAction(){
$result = $this->shopkeeperService->getDiliveryManByStoreId($this->memberId); $result = $this->shopkeeperService->getDiliveryManByStoreId($this->storeId,true);
$result=$result?$result:[]; $result=$result?$result:[];
if($result!==false){ if($result!==false){
$this->success($result,\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage); $this->success($result,\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
......
...@@ -111,7 +111,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -111,7 +111,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
*/ */
public function orderReceiveAction(){ public function orderReceiveAction(){
$orderId = $this->req['data']['orderId']; $orderId = $this->req['data']['orderId'];
$result = $this->shopkeeperService->orderReceive($this->memberId, $orderId); $result = $this->shopkeeperService->orderReceive($this->storeId, $orderId,true);
if ($result) { if ($result) {
$this->success(array(), \Our\DescribeConst::successMessage, \Our\DescribeConst::successMessage); $this->success(array(), \Our\DescribeConst::successMessage, \Our\DescribeConst::successMessage);
}else{ }else{
...@@ -128,7 +128,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -128,7 +128,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$pageSize=isset($this->req['data']['pageSize'])?$this->req['data']['pageSize']:10; $pageSize=isset($this->req['data']['pageSize'])?$this->req['data']['pageSize']:10;
$orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:''; $orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:'';
$keyword = isset($this->req['data']['keyword'])?$this->req['data']['keyword']:''; $keyword = isset($this->req['data']['keyword'])?$this->req['data']['keyword']:'';
$result = $this->shopkeeperService->getStoreOrders($this->memberId,$pageIndex,$pageSize,$orderState,$keyword); $result = $this->shopkeeperService->getStoreOrders($this->storeId,$pageIndex,$pageSize,$orderState,$keyword,true);
$this->success($result); $this->success($result);
if($result){ if($result){
$this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage); $this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
...@@ -143,7 +143,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -143,7 +143,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$pageSize=$this->getPageSize(); $pageSize=$this->getPageSize();
$orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:''; $orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:'';
$keyword = isset($this->req['data']['keyword'])?$this->req['data']['keyword']:''; $keyword = isset($this->req['data']['keyword'])?$this->req['data']['keyword']:'';
$result = $this->shopkeeperService->getOrders($this->memberId,$pageIndex,$pageSize,$orderState,$keyword); $result = $this->shopkeeperService->getOrders($this->storeId,$pageIndex,$pageSize,$orderState,$keyword,true);
$this->success($result); $this->success($result);
// if($result){ // if($result){
// $this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage); // $this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
...@@ -183,7 +183,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -183,7 +183,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
* 获得订单数量 * 获得订单数量
*/ */
public function countAction(){ public function countAction(){
$result = $this->shopkeeperService->getCount($this->memberId); $result = $this->shopkeeperService->getCount($this->storeId);
if(!empty($result)){ if(!empty($result)){
$this->success($result); $this->success($result);
} }
...@@ -193,7 +193,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient { ...@@ -193,7 +193,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
public function receivePaymentAction(){ public function receivePaymentAction(){
$shopkeeperService=\Business\Store\ShopkeeperServiceModel::getInstance(); $shopkeeperService=\Business\Store\ShopkeeperServiceModel::getInstance();
$res=$shopkeeperService->confirmReceivePayment($this->memberId,$this->req['data']['orderId']); $res=$shopkeeperService->confirmReceivePayment($this->memberId,$this->storeId,$this->req['data']['orderId']);
if($res){ if($res){
$this->success(array(),\Our\DescribeConst::successMessage); $this->success(array(),\Our\DescribeConst::successMessage);
}else{ }else{
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<span id="price"></span> <span id="price"></span>
</div> </div>
<div class="qrcode" id="qrcode"> <div class="qrcode" id="qrcode">
<img id="qrImg" src="" /> <img id="qrImg" width="250" height="250" src="" />
<div id="qrcodeImg"></div> <div id="qrcodeImg"></div>
<p id="tip"></p> <p id="tip"></p>
</div> </div>
...@@ -63,13 +63,11 @@ ...@@ -63,13 +63,11 @@
if(pageObj.price != pageObj.discount) if(pageObj.price != pageObj.discount)
document.getElementById("price").innerHTML = "<span style='font-size:30px;'>¥</span>"+(pageObj.price / 100).toFixed(2); document.getElementById("price").innerHTML = "<span style='font-size:30px;'>¥</span>"+(pageObj.price / 100).toFixed(2);
if(pageObj.type<=2){
new QRCode(document.getElementById('qrcodeImg'), pageObj.url); document.getElementById("qrImg").src = pageObj.qrImg;}
// if(pageObj.type<=2){ else{
// document.getElementById("qrImg").src = pageObj.qrImg;} new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// else{ }
// new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// }
......
...@@ -161,6 +161,7 @@ ...@@ -161,6 +161,7 @@
</div> </div>
</body> </body>
<script> <script>
// new QRCode(document.getElementById('qrcodeImg'), { // new QRCode(document.getElementById('qrcodeImg'), {
// text: '<?php //echo $params['qrCode']."?x-oss-process=image/resize,m_fill,h_186,w_186";?>//', // text: '<?php //echo $params['qrCode']."?x-oss-process=image/resize,m_fill,h_186,w_186";?>//',
// width: 250, // width: 250,
......
...@@ -162,11 +162,19 @@ ...@@ -162,11 +162,19 @@
</div> </div>
</body> </body>
<script> <script>
new QRCode(document.getElementById('qrcodeImg'), { var shareType="<?php echo $params['shareType'];?>";
text: '<?php echo $params['qrCode'];?>', var qrCode='<?php echo $params['qrCode'];?>';
width: 250, var shareType=parseInt(shareType);
height: 250 if(shareType==1 || shareType==2){
document.getElementById('qrcodeImg').innerHTML='<img id="qrcodeImg" src="'+ qrCode+'" alt="">';
}else{
new QRCode(document.getElementById('qrcodeImg'), {
text: '<?php echo $params['qrCode'];?>',
width: 250,
height: 250
});
}
});
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="detail"> <div class="detail">
<p class="title c1 s1"><?php echo $problem['problemTitle'];?></p> <p class="title c1 s1"><?php echo $problem['problemTitle'];?></p>
<p class="desc c3 s3"> <p class="desc c3 s3">
<?php echo $problem['problemContent'];?> <?php echo htmlspecialchars_decode($problem['problemContent']);?>
</p> </p>
</div> </div>
</body> </body>
......
...@@ -122,7 +122,7 @@ config.url.resourcesHost = "http://local.qm.com" ...@@ -122,7 +122,7 @@ config.url.resourcesHost = "http://local.qm.com"
config.url.userHost = "" config.url.userHost = ""
; oss 域名 ; oss 域名
config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com" config.url.ossHost = "https://imgpre.shenbd.com"
;推送域名 ;推送域名
config.url.pushHost="192.168.1.201:9503"; config.url.pushHost="192.168.1.201:9503";
......
<?php
/**
* APP微信支付回调
* User: liuyuzhen
* Date: 2018/7/3
* Time: 15:23
* Description:
*/
include 'security.php';
date_default_timezone_set("Asia/Shanghai");
mb_internal_encoding("UTF-8");
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../'));
error_reporting(E_ALL);
define("APP_ENV",ini_get('yaf.environ'));
define("TIMESTAMP",time());
$app = new \Yaf\Application(APPLICATION_PATH . "/conf/application.ini");
$app->bootstrap();
$paymentService = \Business\Order\PaymentServiceModel::getInstance();
$paymentService->updateOrderToPayed(\Our\NameConst::wxAppChannel,true);
\ No newline at end of file
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