本文整理匯總了PHP中Appointment::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Appointment::search方法的具體用法?PHP Appointment::search怎麽用?PHP Appointment::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Appointment
的用法示例。
在下文中一共展示了Appointment::search方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionSearch
public function actionSearch()
{
$model = new Appointment('search');
if (!$model->app_type) {
$model->app_type = [Appointment::TYPE_VIEWING, Appointment::TYPE_VALUATION];
}
if (!$model->app_notetype) {
$model->app_notetype = Appointment::getNoteTypes();
}
if (!$model->app_start) {
$model->app_start = date('d-m-Y', strtotime('-1 year'));
}
if (isset($_GET['Appointment']) && $_GET['Appointment']) {
$model->attributes = $_GET['Appointment'];
}
$dataProvider = $model->search();
$dataProvider->getCriteria()->select = ['t.app_status', 't.app_start', 't.app_type', 't.app_notetype', 't.app_subject', 't.app_user'];
$dataProvider->getCriteria()->with['clients']['select'] = ['clients.cli_fname', 'clients.cli_sname'];
$dataProvider->getCriteria()->with['_instructions']['select'] = ['_instructions.dea_id'];
$dataProvider->getCriteria()->with['user']['select'] = ['user.use_fname', 'user.use_sname'];
$this->render('search', compact('model', 'dataProvider'));
}