コード例 #1
0
 public function search($params, $id)
 {
     $query = DetailList::find()->where(['KD_RIB' => $id]);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         //return $dataProvider;
         //$dataProvider->query->where('0=1');
         return $dataProvider;
     }
     // $query->andFilterWhere(['like', 'KD_RIB', $this->KD_RO])
     //         ->andFilterWhere(['like', 'r0001.KD_CORP', $this->getAttribute('corp.CORP_NM')])
     //         ->andFilterWhere(['like', 'EMP_NM', $this->EMP_NM])
     //         ->andFilterWhere(['like', 'u0002a.DEP_NM', $this->getAttribute('dept.DEP_NM')]);
     // if($this->CREATED_AT!=''){
     //     $date_explode = explode(" - ", $this->CREATED_AT);
     //     $date1 = trim($date_explode[0]);
     //     $date2= trim($date_explode[1]);
     //     $query->andFilterWhere(['between','CREATED_AT', $date1,$date2]);
     // }
     return $dataProvider;
 }
コード例 #2
0
 public function actionListAll($kd, $term_id, $cust_kd)
 {
     $model = new DetailList();
     if ($model->load(Yii::$app->request->post())) {
         $model->TERM_ID = $term_id;
         $model->KD_RIB = $kd;
         $model->save();
         return $this->redirect(['/purchasing/request-term/edit?kd=' . $model->KD_RIB]);
     } else {
         return $this->renderAjax('list_store', ['model' => $model, 'items' => self::aryData_Customers($cust_kd), 'list_store' => self::aryData_invest($term_id)]);
     }
 }