Ejemplo n.º 1
0
 /**
  * 获取团期
  * @author wjh 2014-8-15
  * @param $gid parent_gid
  * @param int $status 状态
  * @param int $limit 记录数量
  * @param int $itemIndex 行的索引
  * @return string
  */
 public static function getGroupDatesBySearch2($gid, $status = 0, $limit = 10)
 {
     $status_str = empty($status) ? '' : " and status=" . $status;
     $dates = BSqlHelper::queryAll("select gid,group_date,status from `group` where isdelete=0 {$status_str} and parent_gid='{$gid}' order by group_date");
     $weeks = array();
     foreach ($dates as $index => $date) {
         $w = date('d/m', strtotime($date['group_date']));
         $title = BDataHelper::getStr(Group::$ARRAY_GROUP_STATUS, $date['status']);
         $weeks[] = empty($status) ? "<span class='label log-info label-info uz-bg-group-status-{$date['status']}' title='{$date["gid"]}({$title})' style='margin:0.1em;'>" . $w . "</span>" : $w;
     }
     $weeks = array_slice($weeks, 0, $limit);
     $strs = implode(',', $weeks);
     return $strs;
 }