Commit 2f9f5f74 authored by wwccw0591's avatar wwccw0591

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

parents 86acc8bf 24e95ba7
...@@ -44,7 +44,7 @@ class CartController extends \Our\Controller_AbstractApi{ ...@@ -44,7 +44,7 @@ class CartController extends \Our\Controller_AbstractApi{
//获取购物车为空时的广告位 //获取购物车为空时的广告位
$advService = \Business\Common\AdvServiceModel::getInstance(); $advService = \Business\Common\AdvServiceModel::getInstance();
$emptyCartAdvs = $advService->getEmptyCartAdvs(); $emptyCartAdvs = $advService->getEmptyCartAdvs();
$cartList['advs'] = $emptyCartAdvs; $cartList['advs'] = $emptyCartAdvs?$emptyCartAdvs:array();
$this->success($cartList); $this->success($cartList);
} }
......
...@@ -42,7 +42,7 @@ class GoodsController extends \Our\Controller_AbstractIndex { ...@@ -42,7 +42,7 @@ class GoodsController extends \Our\Controller_AbstractIndex {
public function testAction(){ public function testAction(){
//$info = $this->goodsService->recommend(); //$info = $this->goodsService->recommend();
//\Business\Goods\GoodsCommonServiceModel::getInstance()->saleGoods(); //\Business\Goods\GoodsCommonServiceModel::getInstance()->saleGoods();
\Business\Goods\EvaluationServiceModel::getInstance()->autoEvaluate(); \Business\Store\StoreServiceModel::getInstance()->pendingItemsInform();
} }
public function getAttrsAction(){ public function getAttrsAction(){
......
...@@ -76,10 +76,17 @@ class SmsTemplateConst{ ...@@ -76,10 +76,17 @@ class SmsTemplateConst{
), ),
//尊敬的${storename},您的店铺由于${reason}无法通过审核,请登录商户后台查看。 //尊敬的${storename},您的店铺由于${reason}无法通过审核,请登录商户后台查看。
'storeCheckUnpass'=> array( 'storeCheckUnpass'=> array(
'templateId'=>'SMS_151547302', 'templateId'=>'SMS_154495028',
'parameters'=>array( 'parameters'=>array(
'storename', 'storename'
'reason' )
),
//目前共有${storeCount}家商户注册待审核,${weiCount}家微信支付待处理状态(需结合微信服务商状态)。
'storeWaitCheck'=> array(
'templateId'=>'SMS_153996044',
'parameters'=>array(
'storeCount',
'weiCount'
) )
) )
......
...@@ -61,9 +61,9 @@ class WxLitePay extends \Payment\TencentPay{ ...@@ -61,9 +61,9 @@ class WxLitePay extends \Payment\TencentPay{
public function refund($param){ public function refund($param){
if($param['subMchId']){ if($param['subMchId']){
$this->refundService($param); return $this->refundService($param);
}else{ }else{
$this->refundCommon($param); return $this->refundCommon($param);
} }
} }
......
...@@ -537,11 +537,11 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -537,11 +537,11 @@ class OrderServiceModel extends \Business\AbstractModel
$storeDao=\DAO\StoreModel::getInstance(); $storeDao=\DAO\StoreModel::getInstance();
//判断订单目前状态是否允许取消 //判断订单目前状态是否允许取消
$isAllowCancel = $orderDao->isAllowCancel($order); $isAllowCancel = $orderDao->isAllowCancel($order);
//$isAllowCance = true; $isAllowCancel = true;
if ($isAllowCancel) { if ($isAllowCancel) {
$orderDao->db->doTransaction();
$res = $orderDao->updateStatusByOrderId($orderId, ApiConst::orderStateCancel,false,ApiConst::cancelOrderBySelf); $res = $orderDao->updateStatusByOrderId($orderId, ApiConst::orderStateCancel,false,ApiConst::cancelOrderBySelf);
$orderDao->setDb($orderDao->dbName); $orderDao->setDb($orderDao->dbName);
$orderDao->db->doTransaction();
if ($res) { if ($res) {
$this->updateOrderGoodsStoregeByOrderIds(array($orderId)); $this->updateOrderGoodsStoregeByOrderIds(array($orderId));
$order['refundOrderNo']=$refundReturnDao->getRefundsn($order['storeId']); $order['refundOrderNo']=$refundReturnDao->getRefundsn($order['storeId']);
......
...@@ -1230,7 +1230,15 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -1230,7 +1230,15 @@ class StoreServiceModel extends \Business\AbstractModel{
public function updateStoreTotalDeposit(){ public function updateStoreTotalDeposit(){
\DAO\StoreModel::getInstance()->updateStoreDeposit(); \DAO\StoreModel::getInstance()->updateStoreDeposit();
} }
public function pendingItemsInform() {
$storePaymentDao = \DAO\Store\StorePaymentModel::getInstance();
$weiCount = $storePaymentDao->getStorePaymentCount(array('payment_type'=>0,'status'=>0));
$storeRegisterDao = \DAO\Store\QmStoreRegisterModel::getInstance();
$storeCount = $storeRegisterDao->getWaitCheckCount(array('state'=>0));
$settingDAO = \DAO\SettingModel::getInstance();
$phone = $settingDAO->getListCache(array('pending_items_inform_tel'))['pending_items_inform_tel'];
\DAO\ShortMessageModel::getInstance()->sendMessageSmsForPlatform($phone,'storeWaitCheck',array('storeCount'=>$storeCount,'weiCount'=>$weiCount));
}
/** /**
*/ */
private static $_instance = null; private static $_instance = null;
......
...@@ -505,7 +505,6 @@ class RefundReturnModel extends \DAO\AbstractModel ...@@ -505,7 +505,6 @@ class RefundReturnModel extends \DAO\AbstractModel
} else if (intval($orderInfo['paymentType']) == ApiConst::wxProgram) { } else if (intval($orderInfo['paymentType']) == ApiConst::wxProgram) {
$wxpay = \Payment\WxLitePay::getInstance(); $wxpay = \Payment\WxLitePay::getInstance();
$refund_return = $wxpay->refund($param); $refund_return = $wxpay->refund($param);
if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) { if (!($refund_return['return_code'] == 'SUCCESS' && $refund_return['result_code'] == 'SUCCESS')) {
$this->errorMessage = date('Y-m-d') . '微信退款操作执行失败!' . $orderInfo['orderId'] . "\r\n"; $this->errorMessage = date('Y-m-d') . '微信退款操作执行失败!' . $orderInfo['orderId'] . "\r\n";
return false; return false;
......
<?php
namespace DAO\Store;
class QmStoreRegisterModel extends \DAO\AbstractModel
{
/**
* 表名
*
* @var string
*/
protected $_tableName = 'han_qm_store_register';
/**
* 主键
*
* @var string
*/
protected $_primaryKey = 'register_id';
public function init()
{
}
public function getStoreRegisterCount($where) {
return $this->getCountByWhere($where);
}
public function getWaitCheckCount($where) {
$this->setDb($this->dbName);
$result=$this->db->select('count(DISTINCT han_qm_store_register.register_id) AS count')->from($this->_tableName)->join('han_qm_store_register_file','han_qm_store_register.register_id = han_qm_store_register_file.register_id','inner')->where($where)->fetchAll();
return $result ? $result[0]['count'] : 0;
}
/**
* 类实例
*
* @var \DAO\UserModel
*/
private static $_instance = null;
/**
* 获取类实例
*
* @return \DAO\UserModel
*/
public static function getInstance($dbName = \Our\DbNameConst::salveDBConnectName)
{
if (!(self::$_instance instanceof self)) {
self::$_instance = new self($dbName);
}
return self::$_instance;
}
}
<?php
namespace DAO\Store;
class StorePaymentModel extends \DAO\AbstractModel
{
/**
* 表名
*
* @var string
*/
protected $_tableName = 'han_store_payment';
/**
* 主键
*
* @var string
*/
protected $_primaryKey = 'payment_id';
public function init()
{
}
public function getStorePaymentCount($where) {
return $this->getCountByWhere($where);
}
/**
* 类实例
*
* @var \DAO\UserModel
*/
private static $_instance = null;
/**
* 获取类实例
*
* @return \DAO\UserModel
*/
public static function getInstance($dbName = \Our\DbNameConst::salveDBConnectName)
{
if (!(self::$_instance instanceof self)) {
self::$_instance = new self($dbName);
}
return self::$_instance;
}
}
...@@ -80,6 +80,9 @@ class SettingRedisModel extends \Redis\Db1\AbstractModel { ...@@ -80,6 +80,9 @@ class SettingRedisModel extends \Redis\Db1\AbstractModel {
public function tableKeyExists($h){ public function tableKeyExists($h){
return $this->exists($this->calcKey($h)); return $this->exists($this->calcKey($h));
} }
public function tableHGAll($h){
return $this->hGetAll($this->calcKey($h));
}
/** /**
* 类实例 * 类实例
* *
......
<?php
//发布
$redis = new Redis();
$redis->connect('192.168.1.201', 6379);
$message='happy New Year';
$ret=$redis->publish('pushcenter',$message);
<?php
//订阅
ini_set('default_socket_timeout', -1); //不超时
$redis = new Redis();
$redis->connect('192.168.1.201', 6379);
$result=$redis->subscribe(array('pushcenter'), 'callback');
function printTest($meg){
$len=10;
for($i=0;$i<$len;$i++){
sleep(1);
echo $meg."\r\n";
}
}
function callback($instance,$channelName,$message){
printTest($message);
}
<?php
/**
*
* 推送10秒推送一次
*
* @author chenjiebin <sjlinyu@qq.com>
*/
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../../')); //指向public的上一级
require APPLICATION_PATH . '/scripts/crontab/baseCli.php';
require APPLICATION_PATH . '/scripts/crontab/common.php';
error_reporting(E_ALL ^ E_NOTICE);
// redis 没有设置密码
$conf = \Yaf\Registry::get('config')->get('redis.database.params');
$redis=new Redis();
$redis->connect($conf['host'], $conf['port']);
if(!empty($conf['password'])){
$redis->auth($conf['password']);
}
//ini_set('default_socket_timeout', -1);(所有长连接不超时)
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
$result=$redis->subscribe(array('redisPublish'), 'callback');
function printTest($meg){
echo $meg.'213';
}
function callback($instance,$channelName,$message){
printTest($message);
}
<?php
/**
* 待办事务提醒
* 执行时间:8:50~11:00~15:00~17:30
*/
define("APPLICATION_PATH", realpath(dirname(__FILE__) . '/../../../')); //指向public的上一级
require APPLICATION_PATH . '/scripts/crontab/common.php';
\Business\Store\StoreServiceModel::getInstance()->pendingItemsInform();
echo '发送成功';
\ 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