Esempio n. 1
0
        $class = 'label-success';
    } elseif ($model->status === 0) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->statusLabel . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', \common\models\fund\Thirdproduct::labels(), ['class' => 'form-control', 'prompt' => '请筛选'])], ['attribute' => 'intent', 'format' => 'html', 'value' => function ($model) {
    if ($model->intent === 1) {
        $class = 'label-success';
    } elseif ($model->intent === 2) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->intentLabel . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'intent', \common\models\fund\Thirdproduct::yilabels(), ['class' => 'form-control', 'prompt' => '请筛选'])], 'source', ['attribute' => 'creditor', 'value' => function ($model) {
    return $model->typeocUser ? $model->typeocUser->username : '******';
}], ['attribute' => 'maxcreditor', 'value' => function ($model) {
    return $model->typemaxUser ? $model->typemaxUser->username : '******';
}, 'headerOptions' => ['width' => '100']], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'template' => '{view}{update}{delete}{list}{change}', 'buttons' => ['update' => function ($url, $model, $key) {
    return $model->status == 0 || $model->status == 3 ? Html::a('&nbsp;&nbsp;<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => '修改']) : '';
}, 'delete' => function ($url, $model, $key) {
    return $model->status == 0 || $model->status == 3 ? Html::a('&nbsp;&nbsp;<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => '删除', 'data' => ['confirm' => '你确定要删除吗?', 'method' => 'post']]) : '';
}, 'change' => function ($url, $model, $key) {
    return $model->intent == 1 && $model->status != 3 ? Html::a('&nbsp;&nbsp;<span class="glyphicon glyphicon-send"></span>', $url, ['title' => '转为可购债权']) : '';
}]]]]);
?>

</div>
Esempio n. 2
0
 /**
  * 读取未进行的项目   2015年7月10日 09:19:45
  * @return multitype:NULL
  */
 protected function getThirProducts()
 {
     $models = Thirdproduct::find()->andWhere(['intent' => Thirdproduct::INTENT_CHECK])->andWhere(['status' => Thirdproduct::STATUS_ACTIVE])->andWhere(['process_status' => Thirdproduct::PROCESS_STATUS_INACTIVE])->all();
     return $models;
 }
 /**
  * Finds the Thirdproduct model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Thirdproduct the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Thirdproduct::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }