コード例 #1
0
ファイル: boxManage.model.php プロジェクト: ohjack/newErp
 public function checkIfAnIdCanUse($boxNum)
 {
     $sql_apply = "select * from wh_boxApply where boxnum='{$boxNum}'";
     $app_row = $this->dbConn->fetch_first($sql_apply);
     if (FALSE === $app_row) {
         self::$errMsg = '不存在的箱号!';
         return FALSE;
     }
     $sql_used = "select * from wh_boxinuse where boxid='{$boxNum}'";
     $used_row = $this->dbConn->fetch_first($sql_used);
     if (FALSE === $used_row) {
         //未被使用 验证通过
         return TRUE;
     } else {
         self::$errMsg = "箱号已被使用!";
         return FALSE;
     }
 }