示例#1
0
 /**
  * Finds the PostJob model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PostJob the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PostJob::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#2
0
            </table>
        </div>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "<div class='wrap'>{summary}{pager}</div>{items}\n<div class='wrap'>{summary}{pager}</div>", 'columns' => ['job_id', 'update_time', ['label' => '工作种类', 'format' => 'raw', 'value' => function ($model) {
    return Yii::$app->params['empl_type'][PostJob::findOne($model->job_id)['service_type']];
}], ['label' => '工作状态', 'format' => 'raw', 'value' => function ($model) {
    return Yii::$app->params['job_status'][PostJob::findOne($model->job_id)['job_status']];
}], ['label' => '地区', 'format' => 'raw', 'value' => function ($model) {
    return PostJob::findOne($model->user_id)['district'];
}], ['label' => '地址', 'format' => 'raw', 'value' => function ($model) {
    return PostJob::findOne($model->user_id)['address'];
}], ['label' => '配置工作人员', 'format' => 'raw', 'value' => function ($model) {
    return Employee::findOne($model->employee_id)['name'];
}], ['label' => '客户', 'format' => 'raw', 'value' => function ($model) {
    return User::findOne($model->user_id)['display_name'];
}], ['label' => '客户电话', 'format' => 'raw', 'value' => function ($model) {
    return PostJob::findOne($model->job_id)['mobile'];
}], ['label' => '付款记录', 'format' => 'raw', 'value' => function ($model) {
    return '记录';
}]]]);
?>

    </div>
</div>
<script src="<?php 
echo $this->context->get_path();
?>
/custom/search.js" type="text/javascript"></script>