Commit ccafa82a authored by zhz's avatar zhz

sendsms

parent 9e7e3d27
...@@ -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(){
......
...@@ -81,6 +81,14 @@ class SmsTemplateConst{ ...@@ -81,6 +81,14 @@ class SmsTemplateConst{
'storename', 'storename',
'reason' 'reason'
) )
),
//目前共有${storeCount}家商户注册待审核,${weiCount}家微信支付待处理状态(需结合微信服务商状态)。
'storeWaitCheck'=> array(
'templateId'=>'SMS_153996044',
'parameters'=>array(
'storeCount',
'weiCount'
)
) )
); );
......
...@@ -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;
......
<?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
/**
* 待办事务提醒
* 执行时间: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