Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="list">
- <option value="mouse">mouse</option>
- <option value="keyboard">keyboard</option>
- <option value="headphones">headphones</option>
- </select>
- $list = Yii::$app->request->post('list', 'mouse')
- $result = Yii::$app->getDb()->createCommand('
- Select *
- from order_table
- where items_sort in :list
- ')->bindValue(':list', '('.$list.')')
- ->queryAll();
- return $result;
- }
- public function actionIndex()
- {
- $data = null;
- if(isset($_GET['last_month'])) {
- $data = order::getTest();
- }
- $dataProvider = new ArrayDataProvider([
- 'allModels' => $data,
- 'sort' => [
- ],
- 'pagination' => [
- 'pageSize' => 50,
- ],
- ]);
- return $this->render('index',['dataProvider' =>$dataProvider]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement