public function actionDetail($id)
{
$model = School::findOne($id);
if (!$model) {
throw new BadRequestHttpException('未找到该学校!');
}
$data['name'] = $model->name;
$data['stores'] = $model->getStores()->select(['id', 'name', 'status', 'address'])->all();
$data['stores'] = array_chunk($data['stores'], 2);
return $data;
}