$stores=$storeDao->getStoreAndFavoriteStore('count(han_favorites_store.favid) AS amount,han_store.store_id,han_favorites_store.store_id AS storeId',array('store_end_time'=>array('gt',TIMESTAMP-\Our\ApiConst::oneDaySecond)),array(),array($pageBegin,500),'storeId','LEFT');
@@ -640,7 +643,7 @@ class StoreModel extends \DAO\AbstractModel
...
@@ -640,7 +643,7 @@ class StoreModel extends \DAO\AbstractModel
*/
*/
publicfunctiongetTryExpireStore(){
publicfunctiongetTryExpireStore(){
$this->setDb($this->dbName);
$this->setDb($this->dbName);
$sql="SELECT store.store_id,store.store_end_time,store.store_phone,store.store_name FROM han_store store LEFT JOIN han_store_class_pay_log store_class_pay_log on store.store_id = store_class_pay_log.store_id where ((unix_timestamp(now())+9*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+10*24*3600) ) or ((unix_timestamp(now())+2*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+3*24*3600) ) or ((unix_timestamp(now())+4*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+5*24*3600) ) and store_class_pay_log.id IS NULL";
$sql="SELECT store.store_id,store.store_end_time,store.store_phone,store.store_name,max(pay_state) AS pay_state FROM han_store store LEFT JOIN han_store_class_pay_log store_class_pay_log on store.store_id = store_class_pay_log.store_id where ((unix_timestamp(now())+9*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+10*24*3600) ) or ((unix_timestamp(now())+2*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+3*24*3600) ) or ((unix_timestamp(now())+4*24*3600) < store.store_end_time and store.store_end_time <= (unix_timestamp(now())+5*24*3600) ) GROUP BY store.store_id HAVING pay_state IS NULL or pay_state = 0";