public function searchmapdetail($params)
 {
     $query = Scheduledetail::find()->where(['CUST_ID' => $params['cust_kd']])->andWhere(['not', ['CHECKOUT_LAT' => null]])->andWhere(['not', ['CHECKOUT_LAG' => null]]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 50]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['ID' => $this->ID, 'TGL' => $this->TGL, 'SCDL_GROUP' => $this->SCDL_GROUP, 'LAT' => $this->LAT, 'LAG' => $this->LAG, 'RADIUS' => $this->RADIUS, 'STATUS' => $this->STATUS, 'CHECKOUT_LAT' => $this->CHECKOUT_LAT, 'CHECKOUT_LAG' => $this->CHECKOUT_LAG]);
     // $query->andFilterWhere(['like', 'CUST_KD', $this->CUST_KD])
     // ->andFilterWhere(['like', 'CUST_KD_ALIAS', $this->CUST_KD_ALIAS])
     // ->andFilterWhere(['like', 'TLP1', $this->TLP1])
     // ->andFilterWhere(['like', 'TLP2', $this->TLP2])
     // ->andFilterWhere(['like', 'FAX', $this->FAX])
     // ->andFilterWhere(['like', 'CUST_KTG', $this->getAttribute('c0001k.CUST_KTG')])
     // ->andFilterWhere(['like', 'CUST_TYPE', $this->getAttribute('custype.CUST_KTG_NM')])
     // ->andFilterWhere(['like', 'CUST_NM', $this->CUST_NM])
     // ->andFilterWhere(['like', 'CUST_GRP', $this->CUST_GRP])
     // ->andFilterWhere(['like', 'MAP_LAT', $this->MAP_LAT])
     // ->andFilterWhere(['like', 'MAP_LNG', $this->MAP_LNG])
     // ->andFilterWhere(['like', 'PIC', $this->PIC])
     // ->andFilterWhere(['like', 'ALAMAT', $this->ALAMAT])
     // ->andFilterWhere(['like', 'EMAIL', $this->EMAIL])
     // ->andFilterWhere(['like', 'WEBSITE', $this->WEBSITE])
     // ->andFilterWhere(['like', 'NOTE', $this->NOTE])
     // ->andFilterWhere(['like', 'NPWP', $this->NPWP])
     // ->andFilterWhere(['like', 'DATA_ALL', $this->DATA_ALL])
     // ->andFilterWhere(['like', 'JOIN_DATE', $this->JOIN_DATE])
     // ->andFilterWhere(['like', 'CUST_GRP', $this->parentName])
     // ->andFilterWhere(['like', 'LAYER', $this->LAYER])
     // ->andFilterWhere(['like', 'GEO', $this->GEO])
     // ->andFilterWhere(['like', 'c0001.STATUS', $this->STATUS])
     // ->andFilterWhere(['like', 'c0001.DC_STATUS', $this->DC_STATUS]);
     //     // ->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])
     //     // ->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])
     //     // ->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     //     $query->orderby(['CUST_GRP'=>SORT_ASC]); //SORT PENTING UNTUK RECURSIVE BIAR TREE BISA URUTAN, save => (IF (PATENT =0) {SORT=ID}, ELSE {SORT=PATENT}, note Parent=ID header
     return $dataProvider;
 }
Example #2
0
 public function CheckExistDetailCustomers($model)
 {
     $cari_customersdetail = Scheduledetail::find()->where(['CUST_ID' => $this->CUST_ID, 'TGL' => $this->TGL])->one();
     if ($cari_customersdetail) {
         $this->addError($model, 'duplicate Customers');
     }
 }
 /** 
  * get data json from Models Scheduledetail
  * place call function _indexViewActual
  * @param $id string
  * @param $grp string
  * @param $userid int
  * @author wawan
  * @since 1.1.0
  **/
 public function actionGetDataActual($id, $userid, $grp)
 {
     //$data = Scheduledetail::find()->with('cust')->where("TGL='".$id."' and NOTE='".$grp."' and USER_ID='".$userid."' and (STATUS=0 or STATUS=1 ) AND STATUS_CASE=0")->asArray()->all();
     //$data = Scheduledetail::find()->with(['cust','tbllayer'])->where("TGL='".$id."' and USER_ID='".$userid."' and (STATUS=0 or STATUS=1 ) AND STATUS_CASE=0")->asArray()->all();
     $data = Scheduledetail::find()->with(['cust', 'tbllayer'])->where("TGL='" . $id . "' and USER_ID='" . $userid . "' and STATUS!=3")->asArray()->all();
     echo json_encode($data);
 }