Exemple #1
0
 public function getScdlPlan()
 {
     // $ary_scdlplan = DraftPlanDetail::find()->where(['CUST_ID'=>$this->CUST_KD,'STATUS'=>0])->distinct()->one();
     $ary_scdlplan = DraftPlanDetail::find()->where('LEFT(TGL,4) ="' . $this->YEAR . '" AND CUST_ID="' . $this->CUST_KD . '" AND STATUS = 0')->distinct()->one();
     return $ary_scdlplan;
 }
 /**
  * Finds the DraftPlandetail count  model based on its CUST_KD value AND    STATUS equal 1.
  * @param string $CUST_KD
  * @return @var ary_scdlplndetail
  */
 protected function findCountStatus($custId, $tgl)
 {
     // $ary_scdlplndetail = DraftPlanDetail::find()->where(['CUST_ID'=>$custId,'STATUS' => 1])->count();
     $ary_scdlplndetail = DraftPlanDetail::find()->where('LEFT(TGL,4) ="' . $tgl . '" AND CUST_ID="' . $custId . '" AND STATUS = 1')->count();
     return $ary_scdlplndetail;
 }
 public function searchEmpty($params)
 {
     $query = DraftPlanDetail::find()->where('STATUS=100');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 0]]);
     return $dataProvider;
 }