如果语句

时间:2016-07-26 06:49:43

标签: javascript php css function if-statement

我有这个功能:

function get_all_in_progress_designments($ now){

$this->db->where('active', 1);
$this->db->where('deleted !=', '1');
$this->db->order_by('date_to', 'DESC');
$designments = $this->db->get('designments')->result_array();
foreach ($designments as $key => &$designment_info) {
    $designment_info['image'] = self::get_image_for_designment($designment_info['designment_id']);

    $designment_info['count_joined'] = self::get_users_count_joined_by_id($designment_info['designment_id']);
    $designment_info['count_ideas'] = self::get_users_count_ideas_by_id($designment_info['designment_id']);
    $date_to = $designment_info['date_to'];
    $diff = $date_to - $now;
    $days = round($diff / 86400);
    $time_left = $days . ' days';

    if($days <= 0){
         $days = 0;

        $time_left = $days . ' days';

它将返回正在进行的图片,标题和说明以及其他一些信息。

为了显示正在进行的和有效的设计之间的差异,我希望正在进行的设计变为灰色ish /透明。有没有办法把它放在函数中?我看到了一些像这样的东西($ image&amp;&amp; imagefilter($ im,IMAGE_FILTER_GRAYSCALE))。 我需要在函数中添加什么才能使其工作?

我希望你能帮助我

亲切的问候,

0 个答案:

没有答案