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 {
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(){
$this->req=$this->getRequest()->getQuery();
$postData=$this->req;
......@@ -37,7 +45,7 @@ class IndexController extends \Our\Controller_Abstract {
}
$this->memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
$paramsStr= $this->memberDb0Redis->tablelpop($this->key);
$paramsStr= $this->memberDb0Redis->tableCacheGet($this->key);
if($_GET['debug']==1){
$paramsStr='{
"desc": "最优质的产品,最实惠的价格,最好的服务质量,欢迎选购",
......
......@@ -720,7 +720,11 @@ class OrderConfirmUtil {
public function delCouponCahce(){
$memberCouponDao = \DAO\Coupon\MemberCouponModel::getInstance();
$couponService = \Business\Coupon\CouponServiceModel::getInstance();
\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(){
......@@ -1227,12 +1231,12 @@ class OrderConfirmUtil {
}
}
}
$storeGoodsList['gcPrices'] = isset($storeGcCouponPriceArray);
$storeGoodsList['gcPrices'] = isset($storeGcCouponPriceArray)?$storeGcCouponPriceArray:array();
$storeGoodsList['goodsCommonPrices'] = $storeGoodsCommonCouponPriceArray;
$storeGoodsList['storeCouponPrice'] = $storeCouponPrice;
$reliefAmount = $cartService->getOneCouponReliefAmount($coupon,$storeGoodsList);
if($reliefAmount&&$reliefAmount>\Our\ApiConst::zero){
$totalPrice = $totalPrice-$reliefAmount;
$totalPrice = ($reliefAmount > $totalPrice)? 0 : ($totalPrice-$reliefAmount);
}
return $totalPrice;
}
......
......@@ -312,6 +312,7 @@ class ApiConst
const signClassStyle = 2;
const isEffective=0;
const notEffectiveAllRefund=3;
const defaultAddressCount = 3;
......@@ -368,7 +369,7 @@ class ApiConst
//等于0表示没有选中地址时是选中当前传入经纬度,等于1表示没有命中地址是选中地址列表中按照is_default desc,address_id desc倒序的第一条地址
const defaultAddressRoute = 0;
const shareLimitProgrameError=40001;
const addGoodsToCart = 1; //将商品加入购物车
const addBundingToCart = 2; //将组合销售商品加入购物车
const positionPickupCodeBegin=12;
......@@ -430,7 +431,7 @@ class ApiConst
const xpClientAppVersionOnline='1.0.0';
const winClientAppVersionOnline='1.0.0';
//微信小是否发布
const isWxPublish = 0;
const isWxPublish = 1;
//消息模板类型
const reachRemindMessageType = 1;
......
This diff is collapsed.
......@@ -94,7 +94,7 @@ class ImageConst{
4=>self::reportPath,
5=>self::memberAvatar
);
const ninTyPath='?x-oss-process=image/resize,m_fill,h_90,w_90';
const sizeScale = 1.5;
const goodsListImgSize = 334;
const CommentGoodsImgSize = 138;
......
......@@ -17,7 +17,8 @@ class PathConst {
const wxGoodsParams="id={0}";
//1:店铺小程序二维码生成路径,2:商品小程序二维码路径
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";
//下载app的页面
......
......@@ -45,6 +45,7 @@ class PayConst {
const wxAppNotifyUrl = '/pay/wxAppNotify.php';
const wxAppNotifyUrlService = '/pay/wxAppNotifyService.php';
const aliAppNotifyUrl = '/pay/aliAppNotify.php';
const wxLiteNotifyUrl = '/pay/wxLiteNotify.php';
const qPayNotifyUrl = '/pay/qPayNotify.php';
......
......@@ -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_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
......
......@@ -33,7 +33,7 @@ class Pay {
$orderInfo = $this->getOrder($wxFlag);
if($data['channel'] == \Our\NameConst::wxAppChannel){
$wxpay = WxPay::getInstance();
unset($orderInfo['subMchId']);
//unset($orderInfo['subMchId']);
$return = $wxpay->doPay($orderInfo);
}else if($data['channel'] == \Our\NameConst::aliApiChannel){
$alipay= Alipay::getInstance();
......
......@@ -22,6 +22,7 @@ class TencentPay {
protected $s_appid ='';
protected $s_key = '';
protected $s_mch_id ='';
protected $s_notify_url = '';
protected $prepay_id ='';
protected $tradeType = '';
public $data;//接收到的数据,类型为关联数组
......@@ -79,11 +80,10 @@ class TencentPay {
$this->parameters['sub_openid'] = $orderInfo['openid'];
}
$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['openid']=$_SESSION['openid'];
//print_r($this->parameters);exit;
\Our\Log::getInstance()->write(json_encode($this->parameters),'/data/log/apptest');
$prepay_id = $this->getPrepayId();
$this->setPrepayId($prepay_id);
}
......@@ -124,7 +124,6 @@ class TencentPay {
$this->postXml($this->orderquery_url);
$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');
if($this->result['return_code']=="SUCCESS"&&$this->result['result_code']=="SUCCESS"&&$this->result['trade_state']=="SUCCESS"){
return true;
}
......@@ -148,9 +147,7 @@ class TencentPay {
function postXml($url=false)
{
$xml = $this->createXml();
\Our\Log::getInstance()->write($xml,'/data/log/applog');
$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;
}
......@@ -360,9 +357,12 @@ class TencentPay {
/**
* 获取notify信息
*/
public function getNotifyInfo() {
public function getNotifyInfo($serviceFlag=false) {
$xml = file_get_contents("php://input");
$this->saveData($xml);
if($serviceFlag){
$this->key= $this->s_key;
}
$verify = false;
if($this->checkSign() == FALSE){
$this->setReturnParameter("return_msg","签名失败");//返回信息
......
......@@ -13,6 +13,7 @@ class WxLitePay extends \Payment\TencentPay{
{
$this->appid = \Our\PayConst::wxLiteAppId;
$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->mch_id = \Our\PayConst::wxPayMchId;
$this->key = \Our\PayConst::wxSPayKey;
......
......@@ -15,7 +15,7 @@ class WxPay extends \Payment\TencentPay
public function __construct()
{
$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->key = \Our\PayConst::wxPayKey;
$this->sslcert_path = \Our\PayConst::wxSslcertPath;
......@@ -25,6 +25,7 @@ class WxPay extends \Payment\TencentPay
$this->s_mch_id = \Our\PayConst::wxSPayMchId;
$this->s_key = \Our\PayConst::wxSPayKey;
$this->s_appid = \Our\PayConst::wxSPayAppId;
$this->s_notify_url = \Our\Common::getBaseUrl().\Our\PayConst::wxAppNotifyUrlService;
}
public function doPay($orderInfo)
......
......@@ -603,7 +603,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false);
$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'];
if($deliverySetting['offlinePay']){
......@@ -680,7 +680,7 @@ class CartServiceModel extends \Business\AbstractModel{
foreach($storeIds as $storeId){
$store = $storeDao->get($storeId,false);
$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['offlinePayway'] = array('payway'=>'','imageUrls'=>array());
if($deliverySetting['offlinePay']){
......
File mode changed from 100755 to 100644
......@@ -670,9 +670,12 @@ class OrderServiceModel extends \Business\AbstractModel
//更新订单信息
$updateData = array('order_state' => ApiConst::orderStateCancel,'is_effective'=>ApiConst::cancelOrderAuto);
$update = $orderDao->update(array('order_id' => $order['orderId']),$updateData);
$updateCommonData['order_message']=DescribeConst::cancelOrderMessage;
$res=$orderCommonDao->update(array('order_id'=>$order['orderId']),$updateCommonData);
if(!$update || !$res){
// $updateCommonData['order_message']=DescribeConst::cancelOrderMessage;
// $res=$orderCommonDao->update(array('order_id'=>$order['orderId']),$updateCommonData);
// if(!$update || !$res){
// echo '订单:'.$order['orderId'].'没取消成功!';
// }
if(!$update){
echo '订单:'.$order['orderId'].'没取消成功!';
}
//$orderGoodsUpdateData['refund_state_name']='退款成功';
......@@ -1167,7 +1170,13 @@ class OrderServiceModel extends \Business\AbstractModel
$paySn = $data['paySn'];
$oldOrderPay = $orderPayModel->find(array('pay_sn'=>$paySn));
$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']))){
\Our\Log::getInstance()->write($data['payFlag'],'/data/log/apptest');
if($oldOrderPay['pay_type']==\Our\ApiConst::wxLitePayType){
$wxLitePay = \Payment\WxLitePay::getInstance();
$storeId = $orderList[0]['store_id'];
......@@ -1179,7 +1188,13 @@ class OrderServiceModel extends \Business\AbstractModel
$payResult = $wxLitePay->getOrderPayResult($paySn,$subMchId);
}else{
$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');
if($payResult){
......@@ -1249,7 +1264,7 @@ class OrderServiceModel extends \Business\AbstractModel
$return['orderState'] = $orderState;
if(isset($data['wxLitePayFlag'])&&$data['wxLitePayFlag']==\Our\ApiConst::one){
$return['paySn'] = $data['paySn'];
if(!$orderState){
if(!$orderState&&!((isset($data['payFlag'])&&$data['payFlag']==\Our\ApiConst::one))){
$orderConfirmUtil = \Order\OrderConfirmUtil::getInstance();
$paySn = $orderConfirmUtil->makeNewPaySnForOrderWithOldPaySn($data['paySn'],$memberId);
$return['paySn'] = $paySn;
......
......@@ -57,7 +57,7 @@ class PaymentServiceModel extends \Business\AbstractModel{
/**
* app微信支付回调
*/
public function updateOrderToPayed($channel = \Our\NameConst::wxAppChannel){
public function updateOrderToPayed($channel = \Our\NameConst::wxAppChannel,$serviceFlag=false){
if($channel == \Our\NameConst::wxLiteChannel){
$wxpay = \Payment\WxLitePay::getInstance();
$param['pay_type'] = \Our\ApiConst::wxLitePayType;
......@@ -68,7 +68,7 @@ class PaymentServiceModel extends \Business\AbstractModel{
$wxpay = \Payment\WxPay::getInstance();
$param['pay_type'] = \Our\ApiConst::wxAppPayType;
}
$callbackInfo = $wxpay->getNotifyInfo();
$callbackInfo = $wxpay->getNotifyInfo($serviceFlag);
if($callbackInfo) {
//验证成功
$param['paySn'] = $callbackInfo['out_trade_no'];
......
......@@ -482,6 +482,7 @@ class RefundServiceModel extends \Business\AbstractModel
$refundReturnDao->db->doRollback();
return false;
}
//$this->recordSellerLog('退款处理,退款编号:'.$refund['refund_sn']); //待确认
//记录操作日志
$sellerLogDAO = \DAO\SellerLogModel::getInstance();
......@@ -512,14 +513,14 @@ class RefundServiceModel extends \Business\AbstractModel
'refundId'=>$refund['refund_id']));
$push->addOneToClient($pushData);
$push->sendTcpMessage();
return true;
}
if($refundAmount > $refund['buyer_refund_amount']){
//showDialog('退款金额不可大于本订单支付金额','','error');
$refundReturnDao->db->doRollback();
return false;
return true;
}
// if($refundAmount > $refund['buyer_refund_amount']){
// //showDialog('退款金额不可大于本订单支付金额','','error');
// $refundReturnDao->db->doRollback();
// return false;
// }
//以下为同意退款流程
if($order_info['order_state']==40){ //交易完成订单,退积分
......@@ -1001,7 +1002,8 @@ class RefundServiceModel extends \Business\AbstractModel
// $shippingTypes = ArrayConst::refundShippingType[$orderInfo['shippingType']];
//获得订单商品
$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');
$allOrderGoods=$orderGoodses;
$goodsIds = $orderGoodsDao->getRefundOrderGoodsIds($orderGoodses);
......@@ -1013,19 +1015,20 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoods = $orderGoodses[$goodsId];
}
if (!empty($orderGoods)) {
array_push($goodsIds, $goodsId);
array_push($goodsIds, (int)$goodsId);
}else{
ErrorModel::throwException(CodeConfigModel::notExistOrderGoods);
}
$shippingFee = ApiConst::zero;
$allReadyGoodsCount=count($goodsIds);
$allGoodsCount=count($orderGoodses);
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
if($allReadyGoodsCount==ApiConst::one){
$shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
}else{
$shippingFee == ApiConst::zero;
}
$shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// if($allReadyGoodsCount==ApiConst::one){
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// }else{
// $shippingFee == ApiConst::zero;
// }
// if (count($orderGoods) == ApiConst::one) {
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// } else {
......@@ -1055,7 +1058,6 @@ class RefundServiceModel extends \Business\AbstractModel
if ($orderInfo['paymentTime']) {
$orderConfirmUtil = \Order\OrderConfirmUtil::getInstance();
if ($orderInfo['couponId']) {
if ($refundCondition) {
$refundCondition['storeCarts']['storeCarts'] = $cartDao->refundGoodsRemove($refundCondition['storeCarts']['storeCarts'], $goodsIds);
......@@ -1070,45 +1072,33 @@ class RefundServiceModel extends \Business\AbstractModel
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
} else {
$refundAmount = $orderGoods['goodsPrice']*$orderGoods['goodsNum'];
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
}
if($allReadyGoodsCount==ApiConst::one){
if($orderInfo['couponId']){
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
}else{
if($allReadyGoodsCount==ApiConst::one){
$refundAmount=$refundAmount+$orderInfo['shippingFee'];
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
}
// if($shippingFee && ($orderInfo['shippingType']==ApiConst::bySeller)){
// $refundAmount=$refundAmount-$orderInfo['shippingFee'];
// }
}else{
if($orderInfo['couponId']){
if($shippingFee){
$refundAmount=$refundAmount-$orderInfo['shippingFee'];
}
//修改后的优惠金额按比例退回
$discountAmount=$orderInfo['originAmount']- $orderInfo['orderAmount'];
$mustReduceAmount=ApiConst::zero;
if($discountAmount){
$orderGoodsConvertes=array();
array_push($orderGoodsConvertes,$orderGoodsConvert);
$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;
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
}
//配送订单配送费按比例收取
// if($orderInfo['shippingType']==ApiConst::bySeller){
// $mustSheepingFee=ApiConst::zero;
......@@ -1267,10 +1257,12 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArray['add_time'] = TIMESTAMP;
$refundArray['refund_type']=$refund['refundType'];
$refundArray['refund_shipping_type']=isset($refund['refundShippingType'])?$refund['refundShippingType']:ApiConst::zero;
$refundArray['payment_type']=$orderInfo['paymentType'];
$refundArrayUnLine=Common::convertUnderline($refundArray);
$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);
$storeDao->deleteStoreCache($orderInfo['storeId'],$orderInfo['orderId']);
......
......@@ -76,7 +76,7 @@ class DeliveryServiceModel extends \Business\AbstractModel
$qmDeliveryManLogData['distribution_fee'] =$data['distributionFee'];
$qmDeliveryManLogData['order_type'] = $data['orderType'];
if($data['orderType']==ApiConst::orderTypeRefund){
$qmDeliveryManLogData['shipping_fee']=$orderD['need_shipping_fee'];
$qmDeliveryManLogData['shipping_fee']=$orderD['needShippingFee'];
}else{
$qmDeliveryManLogData['shipping_fee'] = $orderD['shippingFee'];
}
......
......@@ -213,14 +213,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeMember['fav_type'] = \Our\ApiConst::one;
$storeMembers[] = $storeMember;
$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),'');
if(!$one) {
$result = $favoritesStoreDao->insertAll($storeMembers);
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));
$result = $favoritesStoreDao->insertAll($storeMembers);
if($result) {
$favoritesStoreDao->updateStoreCollecitonsCache(array($storeId),$memberId,2);
}
}else{
......
......@@ -376,8 +376,6 @@ class MemberServiceModel extends \Business\AbstractModel
return false;
}
$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
public function updateMemberAreaInfo(){
$currentTime = TIMESTAMP;
$startTime = $currentTime-\Our\ApiConst::oneDaySecond;
if($currentTime<1545235200){
if($currentTime<1546272000){
$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);
......
......@@ -79,7 +79,7 @@ class ShareServiceModel extends \Business\AbstractModel
}
public function saveDataToSession($data){
$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;
}
//二进制转图片image/png
......@@ -111,6 +111,12 @@ class ShareServiceModel extends \Business\AbstractModel
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){
......@@ -121,12 +127,21 @@ class ShareServiceModel extends \Business\AbstractModel
$scene= \Our\Common::format(\Our\PathConst::wxStoreParams,$data['id']);
$page=\Our\PathConst::wxStorePath;
$res=$this->getQrcode($page,$scene);
$fileName=md5($page.$res);
$fileName=$fileName.NameConst::jpgSuffix;
$base64image=$this->dataUri($res,ImageConst::imagePgn);
$url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this->memberDb0Redis->tableCacheSet($fileName,$url,ApiConst::zero);
return $url;
if(Common::isJson($res)){
$res=json_decode($res,true);
if($res['errcode']==ApiConst::shareLimitProgrameError){
$memberRedis = \Redis\Db0\MemberRedisModel::getInstance();
$memberRedis->tableDel('wechatAccessToken');
$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{
return $this->getQrUrl($data);
// return PathConst::wxDefaultPath;
......@@ -140,15 +155,28 @@ class ShareServiceModel extends \Business\AbstractModel
if($data['type']==\Our\ApiConst::shareGoods){
if(($data['shareType']==ApiConst::shareWxFriend || $data['shareType']==ApiConst::shareWxFriends)){
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;
$res=$this->getQrcode($page,$scene);
$fileName=md5($page.$res);
$fileName=$fileName.NameConst::jpgSuffix;
$base64image=$this->dataUri($res,ImageConst::imagePgn);
$url= ImageUtil::uploadBase64Image($base64image,ImageConst::shareImage,$fileName);
$this->memberDb0Redis->tableCacheSet($fileName,$url,ApiConst::zero);
return $url;
if(Common::isJson($res)){
$res=json_decode($res,true);
if($res['errcode']==ApiConst::shareLimitProgrameError){
$memberRedis = \Redis\Db0\MemberRedisModel::getInstance();
$memberRedis->tableDel('wechatAccessToken');
$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{
return $this->getQrUrl($data,'goods');
//return PathConst::wxDefaultPath;
......
......@@ -75,6 +75,7 @@ abstract class AbstractModel {
public function lists($where=array(),$order='',$field='*',$pageIndex=0,$pageSize=20,$group = null){
$this->db->from($this->_tableName);
$this->db->where($where);
$this->db->select($field);
$count=$this->db->fetchNum();
$this->db->from($this->_tableName);
$this->db->where($where);
......
......@@ -38,10 +38,6 @@ class ArticleModel extends \DAO\AbstractModel{
return $data;
}
public function findFromCache($where,$field= \Our\NameConst::allField){
}
public function getList($where,$field = \Our\NameConst::allField,$order = null){
$this->setDb($this->dbName);
if(is_array($where)){
......@@ -57,6 +53,16 @@ class ArticleModel extends \DAO\AbstractModel{
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{
return false;
}
public function refundGoodsRemove($storeCarts,$goodsIds){
for($i=0;$i<count($storeCarts);$i++){
if(is_array($goodsIds)){
if(in_array($storeCarts[$i]['goodsId'],$goodsIds)){
unset($storeCarts[$i]);
}
}else{
if($storeCarts[$i]['goodsId']==$goodsIds){
unset($storeCarts[$i]);
$newStoreCarts= array();
foreach($storeCarts as $val){
if(is_array($goodsIds)){
if(!in_array($val['goodsId'],$goodsIds)){
array_push($newStoreCarts,$val);
// unset($storeCarts[$i]);
}
}else{
if($val['goodsId']!=$goodsIds){
array_push($newStoreCarts,$val);
}
}
}
}
return $storeCarts;
return $newStoreCarts;
}
public function insertAllOrUpdate($datas){
......
......@@ -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, '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));
return true;
......
......@@ -240,8 +240,15 @@ class GoodsModel extends \DAO\AbstractModel {
if($op==\Our\ApiConst::plus){
$updateGoodsNum = -$updateGoodsNum;
}
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);
......
......@@ -107,6 +107,7 @@ class DiliverymanModel extends \DAO\AbstractModel
}
public function getDeliveryManByStoreId($storeId){
$where['store_id']=$storeId;
$where['is_del']=ApiConst::zero;
return $this->getByWhere($where);
}
......
......@@ -45,7 +45,7 @@ class OrderModel extends \DAO\AbstractModel
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()
......@@ -478,20 +478,30 @@ class OrderModel extends \DAO\AbstractModel
}
public function getOrderOrderTotalOnlineByStoreId($storeId,$today=false){
$this->setDb($this->dbName);
$refundReturnDao=\DAO\Order\RefundReturnModel::getInstance();
$where['store_id']=$storeId;
$where['order_state']=array('notin',ArrayConst::orderCloseAndCancel);
$where['refund_state']=array('neq',ApiConst::refundStateAll);
$where['payment_type']=array('in',ArrayConst::payTypeOnlines);
// $where['refund_state']=array('neq',ApiConst::refundStateAll);
$where['payment_type']=array('in',ArrayConst::orderPayTypeOnlines);
if($today){
$todayBegin=Common::getTodayBeginTimpSpan();
$where['gmt_update']=array('egt',$todayBegin);
$where['gmt_update']=array('elt',TIMESTAMP);
$where['gmt_update']=array('between',$todayBegin,TIMESTAMP);
// $where['gmt_update']=array('elt',TIMESTAMP);
}
if(is_array($where)){
$where= $this->db->getSqlWhereByArray($where);
}
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(order_amount-refund_amount) as orderTotalOnline")->fetchOne();
if($today){
$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();
}
......
......@@ -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 = [])
{
$this->setDb();
......@@ -179,12 +188,17 @@ class OrderGoodsModel extends \DAO\AbstractModel
{
$newOrderGoods = array();
$orderGoods = array_values($orderGoods);
for ($i = ApiConst::zero; $i < count($orderGoods); $i++) {
if ($orderGoods[$i]['refundId'] != ApiConst::zero) {
array_push($newOrderGoods, $orderGoods);
// unset($orderGoods[$i]);
foreach($orderGoods as $orderGood){
if($orderGood['refundId']!=ApiConst::zero){
array_push($newOrderGoods, $orderGood);
}
}
// 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');
return $goodsIds;
}
......@@ -241,7 +255,11 @@ class OrderGoodsModel extends \DAO\AbstractModel
// $allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
// $allGoodsPrice=array_sum($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);
return round($reduceAmount);
......
......@@ -7,6 +7,7 @@ use Error\CodeConfigModel;
use Error\ErrorModel;
use OSS\Common;
use Our\ApiConst;
use Our\ArrayConst;
use Our\DbNameConst;
use Our\DescribeConst;
use Our\ImageConst;
......@@ -43,8 +44,8 @@ class RefundReturnModel extends \DAO\AbstractModel
public function getCount($where)
{
$this->setDb();
return $this->db->from($this->_tableName)->where($where)->fetchNum();
$this->setDb($this->dbName);
return $this->db->from($this->_tableName)->where($where)->select()->fetchNum();
}
public function getAll($where, $field, $db = DbNameConst::salveDBConnectName)
......@@ -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);
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 {
$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();
return !empty($res) ? $res : ApiConst::zero;
......@@ -384,6 +398,7 @@ class RefundReturnModel extends \DAO\AbstractModel
if ($pics) {
foreach ($pics as $pic) {
$readFile = \Our\Common::getStaticFile($pic, ImageConst::refund);
//$readFile.=ImageConst::ninTyPath;
array_push($picsRes, $readFile);
}
}
......@@ -414,7 +429,7 @@ class RefundReturnModel extends \DAO\AbstractModel
}
if (intval($orderInfo['payment_type']) == ApiConst::wxAppPayType) {
$wxpay = \Payment\WxPay::getInstance();
unset($param['subMchId']);
//unset($param['subMchId']);
$refund_return = $wxpay->refund($param);
$this->errorMessage = "微信返回:" . json_encode($refund_return);
if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) {
......@@ -469,7 +484,7 @@ class RefundReturnModel extends \DAO\AbstractModel
}
if (intval($orderInfo['paymentType']) == ApiConst::wxAppPayType) {
$wxpay = \Payment\WxPay::getInstance();
unset($param['subMchId']);
//unset($param['subMchId']);
$refund_return = $wxpay->refund($param);
$this->errorMessage = "微信返回:" . json_encode($refund_return);
if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) {
......@@ -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();
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 $orderState
......
......@@ -300,10 +300,17 @@ class StoreModel extends \DAO\AbstractModel
$favoritesStoreDao = \DAO\FavoritesStoreModel::getInstance();
$orderDao=\DAO\Order\OrderModel::getInstance();
$storeStatisticsDao=\DAO\StoreStatisticsModel::getInstance();
$storeMemberStaticDao=\DAO\StoreMemberStatisticsModel::getInstance();
$favoritesStoreDao->deleteGetFavoritesCountByStoreId($storeId);
$memberFavoritesStoreStoreMemberStatisticsDao = \DAO\Store\MemberFavoritesStoreStoreMemberStatisticsModel::getInstance();
$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);
// \Our\RedisHelper::delCachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeStatisticsDao, 'getByStoreId'), array($storeId), array($storeId));;
$storeStatisticsDao->deleteGetByStoreIdCache($storeId);
}
......@@ -608,7 +615,7 @@ class StoreModel extends \DAO\AbstractModel
$mchId = '';
if($store['wx_pay']){
if(!($store['wxpay_mchid']&&$store['onlinepay_flag'])){
$errorCode = \Error\CodeConfigModel::orderWxPayError;;
$errorCode = \Error\CodeConfigModel::orderWxPayError;
}
$addKey=\Our\Common::getConfig('password.key');
if ($store['wxpay_mchid_sign'] == md5($store['gmt_create'].$store['wxpay_mchid'].$addKey)) {
......
......@@ -44,7 +44,7 @@ class DeliveryController extends \Our\Controller_AbstractClient {
* 获得配送员列表
*/
public function getDeliveriersAction(){
$result = $this->shopkeeperService->getDiliveryManByStoreId($this->memberId);
$result = $this->shopkeeperService->getDiliveryManByStoreId($this->storeId,true);
$result=$result?$result:[];
if($result!==false){
$this->success($result,\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
......
......@@ -111,7 +111,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
*/
public function orderReceiveAction(){
$orderId = $this->req['data']['orderId'];
$result = $this->shopkeeperService->orderReceive($this->memberId, $orderId);
$result = $this->shopkeeperService->orderReceive($this->storeId, $orderId,true);
if ($result) {
$this->success(array(), \Our\DescribeConst::successMessage, \Our\DescribeConst::successMessage);
}else{
......@@ -128,7 +128,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$pageSize=isset($this->req['data']['pageSize'])?$this->req['data']['pageSize']:10;
$orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:'';
$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);
if($result){
$this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
......@@ -143,7 +143,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$pageSize=$this->getPageSize();
$orderState = isset($this->req['data']['orderState'])?$this->req['data']['orderState']:'';
$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);
// if($result){
// $this->success(array(),\Our\DescribeConst::successMessage,\Our\DescribeConst::successMessage);
......@@ -183,7 +183,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
* 获得订单数量
*/
public function countAction(){
$result = $this->shopkeeperService->getCount($this->memberId);
$result = $this->shopkeeperService->getCount($this->storeId);
if(!empty($result)){
$this->success($result);
}
......@@ -193,7 +193,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
public function receivePaymentAction(){
$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){
$this->success(array(),\Our\DescribeConst::successMessage);
}else{
......
......@@ -32,7 +32,7 @@
<span id="price"></span>
</div>
<div class="qrcode" id="qrcode">
<img id="qrImg" src="" />
<img id="qrImg" width="250" height="250" src="" />
<div id="qrcodeImg"></div>
<p id="tip"></p>
</div>
......@@ -63,13 +63,11 @@
if(pageObj.price != pageObj.discount)
document.getElementById("price").innerHTML = "<span style='font-size:30px;'>¥</span>"+(pageObj.price / 100).toFixed(2);
new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// if(pageObj.type<=2){
// document.getElementById("qrImg").src = pageObj.qrImg;}
// else{
// new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
// }
if(pageObj.type<=2){
document.getElementById("qrImg").src = pageObj.qrImg;}
else{
new QRCode(document.getElementById('qrcodeImg'), pageObj.url);
}
......
......@@ -161,6 +161,7 @@
</div>
</body>
<script>
// new QRCode(document.getElementById('qrcodeImg'), {
// text: '<?php //echo $params['qrCode']."?x-oss-process=image/resize,m_fill,h_186,w_186";?>//',
// width: 250,
......
......@@ -162,11 +162,19 @@
</div>
</body>
<script>
new QRCode(document.getElementById('qrcodeImg'), {
text: '<?php echo $params['qrCode'];?>',
width: 250,
height: 250
var shareType="<?php echo $params['shareType'];?>";
var qrCode='<?php echo $params['qrCode'];?>';
var shareType=parseInt(shareType);
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>
</html>
\ No newline at end of file
......@@ -19,7 +19,7 @@
<div class="detail">
<p class="title c1 s1"><?php echo $problem['problemTitle'];?></p>
<p class="desc c3 s3">
<?php echo $problem['problemContent'];?>
<?php echo htmlspecialchars_decode($problem['problemContent']);?>
</p>
</div>
</body>
......
......@@ -122,7 +122,7 @@ config.url.resourcesHost = "http://local.qm.com"
config.url.userHost = ""
; 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";
......
<?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