Ejemplo n.º 1
0
 public function getCar($filters = [])
 {
     $obj = new Sdptd02car();
     $car_info = $obj->getData($filters);
     if (empty($car_info)) {
         return '';
     } else {
         return $car_info[0]['D02_SYAKEN_CYCLE'];
     }
 }
Ejemplo n.º 2
0
 public function deleteData($primaryKey = [])
 {
     $transaction = $this->getDb()->beginTransaction();
     try {
         if (isset($primaryKey['cus_no']) && isset($primaryKey['car_no'])) {
             if ($obj = Sdptd02car::findOne([$primaryKey['cus_no'], $primaryKey['car_no']])) {
                 if (!$obj->delete()) {
                     $transaction->rollback();
                     return false;
                 }
             }
         }
         $delete_job = Sdptd04denpyosagyo::deleteAll('D04_DEN_NO =' . $primaryKey['den_no']);
         $delete_product = Sdptd05denpyocom::deleteAll('D05_DEN_NO =' . $primaryKey['den_no']);
         if (!isset($delete_job) || !isset($delete_product)) {
             $transaction->rollback();
             return false;
         }
         if ($obj = static::findOne($primaryKey['den_no'])) {
             if (!$obj->delete()) {
                 $transaction->rollback();
                 return false;
             }
         }
         $insert = new Sdptw01deldenpyo();
         $insert->setData(['W01_DEN_NO' => $primaryKey['den_no']]);
         if (!$insert->saveData()) {
             $transaction->rollback();
             return false;
         }
         $transaction->commit();
         return true;
     } catch (Exception $e) {
         $transaction->rollback();
     }
     return false;
 }
Ejemplo n.º 3
0
 public function deleteData($where)
 {
     if ($where) {
         return Sdptd02car::deleteAll($where);
     }
     return false;
 }