public function actionLoadGrid() { $id = yii::app()->request->getParam('id'); $page = yii::app()->request->getParam('page'); $rows = yii::app()->request->getParam('rows'); $attachmentName = yii::app()->request->getParam('attachmentName'); $startTime = yii::app()->request->getParam('startTime'); $endTime = yii::app()->request->getParam('endTime'); $sql = " SELECT\n\t\t\tt.Attachment_Id as id,\n\t\t\tt.Attachment_Old_Name as attachmentName,\n\t\t\tt.Attachment_File_Type as attachmentType,\n\t\t\tt.Attachment_Upload_Time as attachmentUpdateTime,\n\t\t\tt.Attachment_Author as attachmentAuthor\n\t\tFROM\n\t\t\tt_s_attachment t\n\t\twhere 1=1 \n\t\t and t.Attachment_Belong_Channel = '" . $id . "'"; $countSql = "SELECT count(*) as num from t_s_attachment t where 1=1 and t.Attachment_Belong_Channel ='" . $id . "'"; if (isset($attachmentName) && !empty($attachmentName)) { $sql .= "and t.Attachment_Old_Name like '%" . $attachmentName . "%'"; $countSql .= " and t.Attachment_Old_Name like '%" . $attachmentName . "%'"; } if (isset($startTime) && !empty($startTime)) { $sql .= ' and t.Attachment_Upload_Time >= ' . $startTime; $countSql .= ' and t.Attachment_Upload_Time >=' . $startTime; } if (isset($endTime) && !empty($endTime)) { $sql .= ' and t.Attachment_Upload_Time <= ' . $endTime; $countSql .= ' and t.Attachment_Upload_Time <=' . $endTime; } $sql .= ' order by t.Attachment_Upload_Time desc'; $easyui = EasyUIModel::getPageData($countSql, $sql, $page, $rows); echo json_encode($easyui, JSON_UNESCAPED_UNICODE); }
public function actionLoadGrid() { $id = yii::app()->request->getParam('id'); $page = yii::app()->request->getParam('page'); $rows = yii::app()->request->getParam('rows'); $article = yii::app()->request->getParam('article'); $startTime = yii::app()->request->getParam('startTime'); $endTime = yii::app()->request->getParam('endTime'); $sql = " SELECT\n\t\t\tt.Id as id,\n\t\t\tt.Article_Title AS title,\n\t\t\tt.Article_Author AS author,\n\t\t\tt.Article_Create_Time AS createTime,\n\t\t\tt.Article_Is_Publish AS publish,\n\t\t\tt.Logo_Image_path AS imagePath\n\t\tFROM\n\t\t\tt_s_article t\n\t\tWHERE\n\t\t\t1 = 1 \n\t\t\tand t.Channel_Identify ='" . $id . "'"; $countSql = "SELECT count(*) as num from t_s_article t where 1=1 and t.Channel_Identify = '" . $id . "'"; if (isset($article) && !empty($article)) { $sql .= "and t.Article_Title like '%" . $article . "%'"; $countSql .= " and t.Article_Title like '%" . $article . "%'"; } if (isset($startTime) && !empty($startTime)) { $sql .= ' and t.Article_Create_Time >= ' . $startTime; $countSql .= ' and t.Article_Create_Time >=' . $startTime; } if (isset($endTime) && !empty($endTime)) { $sql .= ' and t.Article_Create_Time <= ' . $endTime; $countSql .= ' and t.Article_Create_Time <=' . $endTime; } $sql .= ' order by t.Article_Create_Time desc'; $easyui = EasyUIModel::getPageData($countSql, $sql, $page, $rows); echo json_encode($easyui, JSON_UNESCAPED_UNICODE); }
public function actionLoadGrid() { $page = yii::app()->request->getParam('page'); $rows = yii::app()->request->getParam('rows'); $username = yii::app()->request->getParam('username'); $startTime = yii::app()->request->getParam('startTime'); $endTime = yii::app()->request->getParam('endTime'); $sql = ' SELECT t.ID AS id, t.User_Name AS username, t.Create_Time AS createTime, t.Login_Time AS loginTime, t.Enable AS enable FROM t_s_user t WHERE 1 = 1 '; $countSql = 'SELECT count(*) as num from t_s_user t where 1=1 '; if (isset($username) && !empty($username)) { $sql .= "and t.User_Name = '" . $username . "'"; $countSql .= " and t.User_Name = '" . $username . "'"; } if (isset($startTime) && !empty($startTime)) { $sql .= ' and t.Create_Time >= ' . $startTime; $countSql .= ' and t.Create_Time >=' . $startTime; } if (isset($endTime) && !empty($endTime)) { $sql .= ' and t.Create_Time <= ' . $endTime; $countSql .= ' and t.Create_Time <=' . $endTime; } $sql .= ' order by t.Create_Time desc'; $easyui = EasyUIModel::getPageData($countSql, $sql, $page, $rows); echo json_encode($easyui, JSON_UNESCAPED_UNICODE); }