<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ~~~ <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 5 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.php.net/license/3_0.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Original Author <author@example.com> | // | Your Name <you@example.com> | // +----------------------------------------------------------------------+ // // $Id:$ /* * @param $saveWhere :想要更新主鍵ID數組 * @param $saveData :想要更新的ID數組所對應的數據 * @param $tableName : 想要更新的表明 * @param $saveWhere : 返回更新成功后的主鍵ID數組 * */ public function saveAll($saveWhere, &$saveData, $tableName) { if ($saveWhere == null || $tableName == null) return false; //獲取更新的主鍵id名稱 $key = array_keys($saveWhere) [0]; //獲取更新列表的長度 $len = count($saveWhere[$key]); $flag = true; $model = isset($model) ? $model : M($tableName); //開啟事務處理機制 $model->startTrans(); //記錄更新失敗ID $error = []; for ($i = 0; $i < $len; $i++) { //預處理sql語句 $isRight = $model->where($key . '=' . $saveWhere[$key][$i])->save($saveData[$i]); if ($isRight == 0) { //將更新失敗的記錄下來 $error[] = $i; $flag = false; } //$flag=$flag&&$isRight; } if ($flag) { //如果都成立就提交 $model->commit(); return $saveWhere; } elseif (count($error) > 0 & count($error) < $len) { //先將原先的預處理進行回滾 $model->rollback(); for ($i = 0; $i < count($error); $i++) { //刪除更新失敗的ID和Data unset($saveWhere[$key][$error[$i]]); unset($saveData[$error[$i]]); } //重新將數組下標進行排序 $saveWhere[$key] = array_merge($saveWhere[$key]); $saveData = array_merge($saveData); //進行第二次遞歸更新 $this->saveAll($saveWhere, $saveData, $tableName); return $saveWhere; } else { //如果都更新就回滾 $model->rollback(); return false; } } ?> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看