Exemplo n.º 1
0
 /**
  * 判断小区园丁是否是有效的小区园丁
  *
  * @param int $communityId
  * @return bool
  */
 public static function checkCommunityGardenerValidate($communityId)
 {
     $communityGardenerState = static::getCommunityGardenerState($communityId);
     if (empty($communityGardenerState)) {
         return false;
     }
     $gardenerId = $communityGardenerState['gardenerId'];
     if ($gardenerId == 0) {
         return false;
     }
     $brokerApplyHistory = Model_Community_GardenerApply::getBrokerLastApprovalApply($gardenerId, $communityId);
     if (empty($brokerApplyHistory)) {
         return false;
     }
     $lastValidateGardenerDate = date('Ymd', strtotime('-30 day'));
     $applyApprovalDate = date('Ymd', $brokerApplyHistory['updateTime']);
     return $lastValidateGardenerDate < $applyApprovalDate;
 }