/** * Delete all models DraftPlanDetail * update STATUS 0 table c0002scdl_plan according CUST_KD AND STATUS equal 1 * call function action delete-schedule * @param string $id * @since 1.1.1 */ public function Schdelete($id) { $model = DraftPlanDetail::deleteAll('CUST_ID = :cus_id', [':cus_id' => $id]); $this->conn_esm()->CreateCommand('UPDATE c0002scdl_plan SET STATUS=0 WHERE CUST_KD="' . $id . '" AND STATUS = 1')->execute(); return true; }
/** * Finds the DraftPlanDetail model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return DraftPlanDetail the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = DraftPlanDetail::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
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; }
public function searchEmpty($params) { $query = DraftPlanDetail::find()->where('STATUS=100'); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 0]]); return $dataProvider; }