public static function getCommentByScorerAndPicCategory($office_id, $scorer_id, $pic_category, $date = null)
 {
     $start_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignBeginDate();
     $end_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignEndDate();
     $score = self::find()->joinWith('campaignDetail')->andWhere(['wx_office_campaign_detail.office_id' => $office_id])->andWhere(['wx_office_campaign_detail.pic_category' => $pic_category])->andWhere(['staff_id' => $scorer_id])->andWhere('wx_office_campaign_detail.created_time >= :start_time', [':start_time' => $start_date->format("Y-m-d H:i:s")])->andWhere('wx_office_campaign_detail.created_time < :end_time', [':end_time' => $end_date->format("Y-m-d H:i:s")])->one();
     if (empty($score)) {
         return false;
     } else {
         return $score->comment;
     }
 }
Exemple #2
0
                  <?php 
    }
    ?>


                </li>
          <?php 
}
?>

        </ul>

        &nbsp;<br>&nbsp;<br>&nbsp;<br>

      <?php 
$start_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignBeginDate();
$end_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignEndDate();
?>

      <div class="bar bar-standard bar-footer-secondary">
        <a class="btn btn-block btn-primary" style="color:#fff" href="<?php 
echo Url::to(['qdxcjspbpm'], true);
?>
">
        <i class="fa fa-trophy" style="color:#fff"></i>
        排行榜
        </a>
      </div>

      <br>
      <br>
 public static function getDetailReadyStatus($office_id, $date = null)
 {
     $start_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignBeginDate($date);
     $end_date = \app\models\utils\OfficeCampaignUtils::getOfficeCampaignEndDate($date);
     $pic_categories = MOfficeCampaignPicCategory::find()->all();
     $office = \app\models\MOffice::findOne(['office_id' => $office_id]);
     $category_count = 0;
     $detail_count = 0;
     foreach ($pic_categories as $pic_category) {
         if (!$office->is_selfOperated && $pic_category->sort_order == 6) {
             continue;
         }
         $category_count++;
         $detail = self::find()->andWhere(['office_id' => $office_id, 'pic_category' => $pic_category->id])->andWhere('created_time >= :start_time', [':start_time' => $start_date->format("Y-m-d H:i:s")])->andWhere('created_time < :end_time', [':end_time' => $end_date->format("Y-m-d H:i:s")])->one();
         if (!empty($detail)) {
             $detail_count++;
         }
     }
     if ($category_count == $detail_count) {
         return self::DETAIL_COMPLETE;
     }
     if ($detail_count == 0) {
         return self::DETAIL_IMCOMPLETE;
     } else {
         return self::DETAIL_PARTIALLY;
     }
 }