当前位置: 首页>>代码示例>>PHP>>正文


PHP SC_Query::insert方法代码示例

本文整理汇总了PHP中SC_Query::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query::insert方法的具体用法?PHP SC_Query::insert怎么用?PHP SC_Query::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SC_Query的用法示例。


在下文中一共展示了SC_Query::insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lfCopyProductClass

 /**
  * 規格データをコピーする
  *
  * @param  array   $arrList  フォーム入力パラメーター配列
  * @param  SC_Query  $objQuery SC_Queryインスタンス
  * @return boolean エラーフラグ
  */
 public function lfCopyProductClass($arrList, &$objQuery)
 {
     // 複製元のdtb_products_classを取得(規格なしのため、1件のみの取得)
     $col = '*';
     $table = 'dtb_products_class';
     $where = 'product_id = ?';
     $arrProductClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id']));
     //トランザクション開始
     $objQuery->begin();
     $err_flag = false;
     //非編集項目は複製、編集項目は上書きして登録
     foreach ($arrProductClass as $records) {
         foreach ($records as $key => $value) {
             if (isset($arrList[$key])) {
                 switch ($key) {
                     case 'stock_unlimited':
                         $records[$key] = (int) $arrList[$key];
                         break;
                     default:
                         $records[$key] = $arrList[$key];
                         break;
                 }
             }
         }
         $records['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
         $records['update_date'] = 'CURRENT_TIMESTAMP';
         $records['create_date'] = 'CURRENT_TIMESTAMP';
         $objQuery->insert($table, $records);
         //エラー発生時は中断
         if ($objQuery->isError()) {
             $err_flag = true;
             continue;
         }
     }
     //トランザクション終了
     if ($err_flag) {
         $objQuery->rollback();
     } else {
         $objQuery->commit();
     }
     return !$err_flag;
 }
开发者ID:rateon,项目名称:twhk-ec,代码行数:49,代码来源:LC_Page_Admin_Products_Product.php

示例2: lfSetNewAddr

 function lfSetNewAddr($uniqid, $customer_id)
 {
     $objQuery = new SC_Query();
     $diff = false;
     $find_same = false;
     $col = "deliv_name01,deliv_name02,deliv_kana01,deliv_kana02,deliv_tel01,deliv_tel02,deliv_tel03,deliv_zip01,deliv_zip02,deliv_pref,deliv_addr01,deliv_addr02";
     $where = "order_temp_id = ?";
     $arrRet = $objQuery->select($col, "dtb_order_temp", $where, array($uniqid));
     // 要素名のdeliv_を削除する。
     foreach ($arrRet[0] as $key => $val) {
         $keyname = ereg_replace("^deliv_", "", $key);
         $arrNew[$keyname] = $val;
     }
     // 会員情報テーブルとの比較
     $col = "name01,name02,kana01,kana02,tel01,tel02,tel03,zip01,zip02,pref,addr01,addr02";
     $where = "customer_id = ?";
     $arrCustomerAddr = $objQuery->select($col, "dtb_customer", $where, array($customer_id));
     // 会員情報の住所と異なる場合
     if ($arrNew != $arrCustomerAddr[0]) {
         // 別のお届け先テーブルの住所と比較する
         $col = "name01,name02,kana01,kana02,tel01,tel02,tel03,zip01,zip02,pref,addr01,addr02";
         $where = "customer_id = ?";
         $arrOtherAddr = $objQuery->select($col, "dtb_other_deliv", $where, array($customer_id));
         foreach ($arrOtherAddr as $arrval) {
             if ($arrNew == $arrval) {
                 // すでに同じ住所が登録されている
                 $find_same = true;
             }
         }
         if (!$find_same) {
             $diff = true;
         }
     }
     // 新しいお届け先が登録済みのものと異なる場合は別のお届け先テーブルに登録する
     if ($diff) {
         $sqlval = $arrNew;
         $sqlval['customer_id'] = $customer_id;
         $objQuery->insert("dtb_other_deliv", $sqlval);
     }
 }
开发者ID:RyotaKaji,项目名称:eccube-2.4.1,代码行数:40,代码来源:LC_Page_Shopping_Complete.php

示例3: lfInsertProductClass

 function lfInsertProductClass($arrList, $product_id)
 {
     $objQuery = new SC_Query();
     $objQuery->begin();
     // 既存規格の削除
     $where = "product_id = ?";
     $objQuery->delete("dtb_products_class", $where, array($product_id));
     $cnt = 1;
     // すべての規格を登録する。
     while ($arrList["classcategory_id1:" . $cnt] != "") {
         if ($arrList["check:" . $cnt] == 1) {
             $sqlval = array();
             $sqlval['product_id'] = $product_id;
             $sqlval['classcategory_id1'] = $arrList["classcategory_id1:" . $cnt];
             $sqlval['classcategory_id2'] = $arrList["classcategory_id2:" . $cnt];
             if (strlen($arrList["product_class_id:" . $cnt]) > 0) {
                 $sqlval['product_class_id'] = $arrList["product_class_id:" . $cnt];
             }
             $sqlval['product_code'] = $arrList["product_code:" . $cnt];
             $sqlval['stock'] = $arrList["stock:" . $cnt];
             $sqlval['stock_unlimited'] = $arrList["stock_unlimited:" . $cnt];
             $sqlval['price01'] = $arrList['price01:' . $cnt];
             $sqlval['price02'] = $arrList['price02:' . $cnt];
             $sqlval['creator_id'] = $_SESSION['member_id'];
             $sqlval['create_date'] = "now()";
             $sqlval['update_date'] = "now()";
             // INSERTの実行
             $objQuery->insert("dtb_products_class", $sqlval);
         }
         $cnt++;
     }
     $objQuery->commit();
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:33,代码来源:LC_Page_Admin_Products_ProductClass.php

示例4: lfExeInsertSQL

 /**
  * CSVファイルからインサート実行.
  *
  * @param  SC_Query $objQuery
  * @param  string $dir
  * @param  string $mode
  * @return boolean
  */
 public function lfExeInsertSQL(&$objQuery, $dir, $mode)
 {
     $tbl_flg = false;
     $col_flg = false;
     $ret = true;
     $pagelayout_flg = false;
     $arrVal = array();
     $arrCol = array();
     $arrAllTableList = $objQuery->listTables();
     $objDir = dir($dir);
     while (false !== ($file_name = $objDir->read())) {
         if (!preg_match('/^((dtb|mtb|plg)_(\\w+))\\.csv$/', $file_name, $matches)) {
             continue;
         }
         $file_path = $dir . $file_name;
         $table = $matches[1];
         // テーブル存在チェック
         if (!in_array($table, $arrAllTableList)) {
             if ($mode === 'restore_config') {
                 continue;
             }
             return false;
         }
         // csvファイルからデータの取得
         $fp = fopen($file_path, 'r');
         if ($fp === false) {
             trigger_error($file_name . ' のファイルオープンに失敗しました。', E_USER_ERROR);
         }
         GC_Utils_Ex::gfPrintLog('リストア実行: ' . $table);
         $objQuery->delete($table);
         $line = 0;
         $arrColName = array();
         while (!feof($fp)) {
             $line++;
             $arrCsvLine = fgetcsv($fp, 1024 * 1024);
             // 1行目: 列名
             if ($line === 1) {
                 $arrColName = $arrCsvLine;
                 continue;
             }
             // 空行を無視
             // false との比較は PHP 5.2.x Windows バグ対応
             // 参考: http://www.php.net/manual/ja/function.fgetcsv.php#98502
             if ($arrCsvLine === array(null) || $arrCsvLine === false) {
                 continue;
             }
             $arrVal = array_combine($arrColName, $arrCsvLine);
             $objQuery->insert($table, $arrVal);
             SC_Utils_Ex::extendTimeOut();
         }
         fclose($fp);
     }
     return $ret;
 }
开发者ID:casan,项目名称:eccube-2_13,代码行数:62,代码来源:LC_Page_Admin_System_Bkup.php

示例5: sfCountCategory


//.........这里部分代码省略.........
        $arrNew = array();
        foreach ($arrCategoryCountNew as $item) {
            $arrNew[$item['category_id']] = $item['product_count'];
        }
        unset($arrCategoryCountOld);
        unset($arrCategoryCountNew);
        $arrDiffCategory_id = array();
        //新しいカテゴリ一覧から見て商品数が異なるデータが無いか確認
        foreach ($arrNew as $cid => $count) {
            if ($arrOld[$cid] != $count) {
                $arrDiffCategory_id[] = $cid;
            }
        }
        //削除カテゴリを想定して、古いカテゴリ一覧から見て商品数が異なるデータが無いか確認。
        foreach ($arrOld as $cid => $count) {
            if ($arrNew[$cid] != $count && $count > 0) {
                $arrDiffCategory_id[] = $cid;
            }
        }
        //対象IDが無ければ終了
        if (count($arrDiffCategory_id) == 0) {
            if ($is_out_trans) {
                $objQuery->commit();
            }
            return;
        }
        //差分対象カテゴリIDの重複を除去
        $arrDiffCategory_id = array_unique($arrDiffCategory_id);
        //dtb_category_countの更新 差分のあったカテゴリだけ更新する。
        foreach ($arrDiffCategory_id as $cid) {
            $sqlval = array();
            $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
            $sqlval['product_count'] = (string) $arrNew[$cid];
            if ($sqlval['product_count'] == '') {
                $sqlval['product_count'] = (string) '0';
            }
            if (isset($arrOld[$cid])) {
                $objQuery->update('dtb_category_count', $sqlval, 'category_id = ?', array($cid));
            } else {
                if ($is_force_all_count) {
                    $ret = $objQuery->update('dtb_category_count', $sqlval, 'category_id = ?', array($cid));
                    if ($ret > 0) {
                        continue;
                    }
                }
                $sqlval['category_id'] = $cid;
                $objQuery->insert('dtb_category_count', $sqlval);
            }
        }
        unset($arrOld);
        unset($arrNew);
        //差分があったIDとその親カテゴリIDのリストを取得する
        $arrTgtCategory_id = array();
        foreach ($arrDiffCategory_id as $parent_category_id) {
            $arrTgtCategory_id[] = $parent_category_id;
            $arrParentID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $parent_category_id);
            $arrTgtCategory_id = array_unique(array_merge($arrTgtCategory_id, $arrParentID));
        }
        unset($arrDiffCategory_id);
        //dtb_category_total_count 集計処理開始
        //更新対象カテゴリIDだけ集計しなおす。
        $arrUpdateData = array();
        $where_products_class = '';
        if (NOSTOCK_HIDDEN) {
            $where_products_class .= '(stock >= 1 OR stock_unlimited = 1)';
        }
        $from = $objProduct->alldtlSQL($where_products_class);
        foreach ($arrTgtCategory_id as $category_id) {
            $arrWhereVal = array();
            list($tmp_where, $arrTmpVal) = $this->sfGetCatWhere($category_id);
            if ($tmp_where != '') {
                $sql_where_product_ids = 'product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')';
                $arrWhereVal = $arrTmpVal;
            } else {
                $sql_where_product_ids = '0<>0';
                // 一致させない
            }
            $where = "({$sql_where}) AND ({$sql_where_product_ids})";
            $arrUpdateData[$category_id] = $objQuery->count($from, $where, $arrWhereVal);
        }
        unset($arrTgtCategory_id);
        // 更新対象だけを更新。
        foreach ($arrUpdateData as $cid => $count) {
            $sqlval = array();
            $sqlval['create_date'] = 'CURRENT_TIMESTAMP';
            $sqlval['product_count'] = $count;
            if ($sqlval['product_count'] == '') {
                $sqlval['product_count'] = (string) '0';
            }
            $ret = $objQuery->update('dtb_category_total_count', $sqlval, 'category_id = ?', array($cid));
            if (!$ret) {
                $sqlval['category_id'] = $cid;
                $objQuery->insert('dtb_category_total_count', $sqlval);
            }
        }
        // トランザクション終了処理
        if ($is_out_trans) {
            $objQuery->commit();
        }
    }
开发者ID:rateon,项目名称:twhk-ec,代码行数:101,代码来源:SC_Helper_DB.php

示例6: lfInsertData

 function lfInsertData()
 {
     // 入力データを渡す。
     $sqlval = $this->objFormParam->getHashArray();
     $sqlval['update_date'] = 'Now()';
     $objQuery = new SC_Query();
     // INSERTの実行
     $ret = $objQuery->insert("dtb_baseinfo", $sqlval);
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:9,代码来源:LC_Page_Admin_Basis_Tradelaw.php

示例7: lfRegistProduct

 /**
  * カテゴリ登録を行う.
  *
  * @param SC_Query $objQuery SC_Queryインスタンス
  * @param string|integer $line 処理中の行数
  * @return void
  */
 function lfRegistProduct($objQuery, $line = "")
 {
     $objDb = new SC_Helper_DB_Ex();
     $arrRet = $this->objFormParam->getHashArray();
     //カテゴリID
     if ($arrRet['category_id'] == 0) {
         $category_id = $objQuery->max("dtb_category", "category_id") + 1;
         $sqlval['category_id'] = $category_id;
         $update = false;
     } else {
         $sqlval['category_id'] = $arrRet['category_id'];
         $update = true;
     }
     // カテゴリ名
     $sqlval['category_name'] = $arrRet['category_name'];
     // 親カテゴリID、レベル
     if ($arrRet['parent_category_id'] == 0) {
         $sqlval['parent_category_id'] = "0";
         $sqlval['level'] = 1;
     } else {
         $sqlval['parent_category_id'] = $arrRet['parent_category_id'];
         $parent_level = $objQuery->get("dtb_category", "level", "category_id = ?", array($sqlval['parent_category_id']));
         $sqlval['level'] = $parent_level + 1;
     }
     // その他
     $time = date("Y-m-d H:i:s");
     if ($line != "") {
         $microtime = sprintf("%06d", $line);
         $time .= ".{$microtime}";
     }
     $sqlval['update_date'] = $time;
     $sqlval['creator_id'] = $_SESSION['member_id'];
     // 更新
     if ($update) {
         echo "UPDATE ";
         $where = "category_id = ?";
         $objQuery->update("dtb_category", $sqlval, $where, array($sqlval['category_id']));
         // 新規登録
     } else {
         echo "INSERT ";
         $sqlval['create_date'] = $time;
         // ランク
         if ($sqlval['parent_category_id'] == 0) {
             // ROOT階層で最大のランクを取得する。
             $where = "parent_category_id = ?";
             $sqlval['rank'] = $objQuery->max("dtb_category", "rank", $where, array($sqlval['parent_category_id'])) + 1;
         } else {
             // 親のランクを自分のランクとする。
             $where = "category_id = ?";
             $sqlval['rank'] = $objQuery->get("dtb_category", "rank", $where, array($sqlval['parent_category_id']));
             // 追加レコードのランク以上のレコードを一つあげる。
             $sqlup = "UPDATE dtb_category SET rank = (rank + 1) WHERE rank >= ?";
             $objQuery->exec($sqlup, array($sqlval['rank']));
         }
         $objQuery->insert("dtb_category", $sqlval);
     }
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:64,代码来源:LC_Page_Admin_Products_UploadCSVCategory.php

示例8: process

 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objQuery = new SC_Query();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     $fp = fopen(ZIP_CSV_FILE_PATH, "r");
     $img_path = USER_URL . "packages/" . TEMPLATE_NAME . "/img/";
     // 一部のIEは256バイト以上受け取ってから表示を開始する。
     for ($i = 0; $i < 256; $i++) {
         print " ";
     }
     print "\n";
     $this->myFlush();
     if (!$fp) {
         SC_Utils_Ex::sfErrorHeader(">> " . ZIP_CSV_FILE_PATH . "の取得に失敗しました。");
     } else {
         print "<img src='" . $img_path . "install/main_w.jpg'><br>";
         $this->myFlush();
         // CSVの件数を数える
         $line = 0;
         while (!feof($fp)) {
             fgets($fp, ZIP_CSV_LINE_MAX);
             $line++;
         }
         print "<img src='" . $img_path . "install/space_w.gif'>";
         $this->myFlush();
         // ファイルポインタを戻す
         fseek($fp, 0);
         // 画像を一個表示する件数を求める。
         $disp_line = intval($line / IMAGE_MAX);
         // 既に書き込まれたデータを数える
         $end_cnt = $objQuery->count("mtb_zip");
         $cnt = 1;
         $img_cnt = 0;
         while (!feof($fp)) {
             $arrCSV = fgetcsv($fp, ZIP_CSV_LINE_MAX);
             // すでに書き込まれたデータを飛ばす。
             if ($cnt > $end_cnt) {
                 $sqlval['code'] = $arrCSV[0];
                 $sqlval['old_zipcode'] = $arrCSV[1];
                 $sqlval['zipcode'] = $arrCSV[2];
                 $sqlval['state_kana'] = $arrCSV[3];
                 $sqlval['city_kana'] = $arrCSV[4];
                 $sqlval['town_kana'] = $arrCSV[5];
                 $sqlval['state'] = $arrCSV[6];
                 $sqlval['city'] = $arrCSV[7];
                 $sqlval['town'] = $arrCSV[8];
                 $sqlval['flg1'] = $arrCSV[9];
                 $sqlval['flg2'] = $arrCSV[10];
                 $sqlval['flg3'] = $arrCSV[11];
                 $sqlval['flg4'] = $arrCSV[12];
                 $sqlval['flg5'] = $arrCSV[13];
                 $sqlval['flg6'] = $arrCSV[14];
                 $objQuery->insert("mtb_zip", $sqlval);
             }
             $cnt++;
             // $disp_line件ごとに進捗表示する
             if ($cnt % $disp_line == 0 && $img_cnt < IMAGE_MAX) {
                 print "<img src='" . $img_path . "install/graph_1_w.gif'>";
                 $this->myFlush();
                 $img_cnt++;
             }
         }
         fclose($fp);
         print "<img src='" . $img_path . "install/space_w.gif'><br>\n";
         print "<table width='700' height='50' border='0' cellpadding='0' cellspacing='0' bgcolor='#494E5F'>\n";
         print "<tr>\n";
         print "<td align='center'><a href='javascript:window.close()'><img src='" . $img_path . "install/close.gif' alt='CLOSE' width='85' height='22' border='0' /></a></td>\n";
         print "</tr>\n";
         print "</table>\n";
     }
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:78,代码来源:LC_Page_Admin_Basis_ZipInstall.php

示例9: lfInsertClass

 function lfInsertClass($arrData)
 {
     $objQuery = new SC_Query();
     // INSERTする値を作成する。
     $sqlval['name'] = $arrData['name'];
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $sqlval['rank'] = $objQuery->max("dtb_class", "rank") + 1;
     $sqlval['create_date'] = "now()";
     $sqlval['update_date'] = "now()";
     // INSERTの実行
     $ret = $objQuery->insert("dtb_class", $sqlval);
     return $ret;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:13,代码来源:LC_Page_Admin_Products_Class.php

示例10: lfRegistData

 /**
  * 配送情報を登録する
  *
  * @return $deliv_id 
  */
 function lfRegistData()
 {
     $arrRet = $this->objFormParam->getHashArray();
     $objQuery = new SC_Query();
     $objQuery->begin();
     // 入力データを渡す。
     $sqlval['name'] = $arrRet['name'];
     $sqlval['service_name'] = $arrRet['service_name'];
     $sqlval['confirm_url'] = $arrRet['confirm_url'];
     $sqlval['creator_id'] = $_SESSION['member_id'];
     $sqlval['update_date'] = 'Now()';
     // deliv_id が決まっていた場合
     if ($_POST['deliv_id'] != "") {
         $deliv_id = $_POST['deliv_id'];
         $where = "deliv_id = ?";
         $objQuery->update("dtb_deliv", $sqlval, $where, array($deliv_id));
         // 配送時間の登録
         $table = "dtb_delivtime";
         $where = "deliv_id = ? AND time_id = ?";
         for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
             $sqlval = array();
             $keyname = "deliv_time" . $cnt;
             $arrval = array($deliv_id, $cnt * $deliv_id);
             // 既存データの有無を確認
             $curData = $objQuery->select("*", $table, $where, $arrval);
             if (strcmp($arrRet[$keyname], "") != 0) {
                 $sqlval['deliv_time'] = $arrRet[$keyname];
                 // 入力が空ではなく、DBに情報があれば更新
                 if (count($curData)) {
                     $objQuery->update($table, $sqlval, $where, $arrval);
                 } else {
                     $sqlval['deliv_id'] = $deliv_id;
                     $sqlval['time_id'] = $cnt * $deliv_id;
                     $objQuery->insert($table, $sqlval);
                 }
             } else {
                 if (count($curData)) {
                     $objQuery->delete($table, $where, $arrval);
                 }
             }
         }
         // 配送料の登録
         if (INPUT_DELIV_FEE) {
             for ($cnt = 1; $cnt <= DELIVFEE_MAX; $cnt++) {
                 $keyname = "fee" . $cnt;
                 if (strcmp($arrRet[$keyname], "") != 0) {
                     $sqlval = array('fee' => $arrRet[$keyname]);
                     $objQuery->update("dtb_delivfee", $sqlval, "deliv_id = ? AND pref = ?", array($deliv_id, $cnt));
                 }
             }
         }
     } else {
         // 登録する配送業者IDの取得
         if (DB_TYPE == "pgsql") {
             $deliv_id = $objQuery->nextval('dtb_deliv', 'deliv_id');
             $sqlval['deliv_id'] = $deliv_id;
         }
         $sqlval['rank'] = $objQuery->max("dtb_deliv", "rank") + 1;
         $sqlval['create_date'] = 'Now()';
         // INSERTの実行
         $objQuery->insert("dtb_deliv", $sqlval);
         if (DB_TYPE == "mysql") {
             $deliv_id = $objQuery->nextval('dtb_deliv', 'deliv_id');
         }
         $sqlval = array();
         // 配送時間の設定
         for ($cnt = 1; $cnt <= DELIVTIME_MAX; $cnt++) {
             $keyname = "deliv_time{$cnt}";
             if ($arrRet[$keyname] != "") {
                 $sqlval['deliv_id'] = $deliv_id;
                 $sqlval['time_id'] = $cnt * $deliv_id;
                 $sqlval['deliv_time'] = $arrRet[$keyname];
                 // INSERTの実行
                 $objQuery->insert("dtb_delivtime", $sqlval);
             }
         }
         if (INPUT_DELIV_FEE) {
             $sqlval = array();
             // 配送料金の設定
             for ($cnt = 1; $cnt <= DELIVFEE_MAX; $cnt++) {
                 $keyname = "fee{$cnt}";
                 if ($arrRet[$keyname] != "") {
                     $sqlval['deliv_id'] = $deliv_id;
                     $sqlval['fee'] = $arrRet[$keyname];
                     $sqlval['pref'] = $cnt;
                     // INSERTの実行
                     $objQuery->insert("dtb_delivfee", $sqlval);
                 }
             }
         }
     }
     $objQuery->commit();
     return $deliv_id;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:99,代码来源:LC_Page_Admin_Basis_Delivery_Input.php

示例11: registerOwnersStoreSettings

 /**
  * DBへ入力内容を登録する.
  *
  * @param array $arrSettingsData オーナーズストア設定の連想配列
  * @return void
  */
 function registerOwnersStoreSettings($arrSettingsData)
 {
     $table = 'dtb_ownersstore_settings';
     $objQuery = new SC_Query();
     $count = $objQuery->count($table);
     if ($count) {
         $objQuery->update($table, $arrSettingsData);
     } else {
         $objQuery->insert($table, $arrSettingsData);
     }
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:17,代码来源:LC_Page_Admin_OwnersStore_Settings.php

示例12: lfDispComplete

function lfDispComplete($objPage)
{
    global $objWebParam;
    global $objDBParam;
    // hiddenに入力値を保持
    $objPage->arrHidden = $objWebParam->getHashArray();
    // hiddenに入力値を保持
    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
    $arrDsn = getArrayDsn($objDBParam);
    $sqlval['id'] = 1;
    $sqlval['shop_name'] = $objWebParam->getValue('shop_name');
    $sqlval['email01'] = $objWebParam->getValue('admin_mail');
    $sqlval['email02'] = $objWebParam->getValue('admin_mail');
    $sqlval['email03'] = $objWebParam->getValue('admin_mail');
    $sqlval['email04'] = $objWebParam->getValue('admin_mail');
    $sqlval['email05'] = $objWebParam->getValue('admin_mail');
    $sqlval['top_tpl'] = 'default1';
    $sqlval['product_tpl'] = 'default1';
    $sqlval['detail_tpl'] = 'default1';
    $sqlval['mypage_tpl'] = 'default1';
    $sqlval['update_date'] = 'CURRENT_TIMESTAMP';
    $objQuery = new SC_Query($arrDsn);
    $cnt = $objQuery->count('dtb_baseinfo');
    if ($cnt > 0) {
        $objQuery->update('dtb_baseinfo', $sqlval);
    } else {
        $objQuery->insert('dtb_baseinfo', $sqlval);
    }
    // 管理者登録
    $login_id = $objWebParam->getValue('login_id');
    $salt = SC_Utils_Ex::sfGetRandomString(10);
    $login_pass = SC_Utils_Ex::sfGetHashString($objWebParam->getValue('login_pass'), $salt);
    $arrVal = array('login_id' => $login_id, 'password' => $login_pass, 'salt' => $salt, 'work' => 1, 'del_flg' => 0, 'update_date' => 'CURRENT_TIMESTAMP');
    $member_id = $objQuery->get('member_id', 'dtb_member', 'login_id = ? AND del_flg = 0', array($login_id));
    if (strlen($member_id) == 0) {
        $member_id = $objQuery->nextVal('dtb_member_member_id');
        $arrVal['member_id'] = $member_id;
        $arrVal['name'] = '管理者';
        $arrVal['creator_id'] = 0;
        $arrVal['authority'] = 0;
        $arrVal['rank'] = 1;
        $objQuery->insert('dtb_member', $arrVal);
    } else {
        $objQuery->update('dtb_member', $arrVal, 'member_id = ?', array($member_id));
    }
    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
    $objPage->tpl_mainpage = 'complete.tpl';
    $objPage->tpl_mode = 'complete';
    $secure_url = $objWebParam->getValue('secure_url');
    // 語尾に'/'をつける
    $secure_url = rtrim($secure_url, '/') . '/';
    $objPage->tpl_sslurl = $secure_url;
    //EC-CUBEオフィシャルサイトからのお知らせURL
    $objPage->install_info_url = INSTALL_INFO_URL;
    return $objPage;
}
开发者ID:nanasess,项目名称:eccube-WindowsAzureBlob-plugin,代码行数:56,代码来源:index.php

示例13: lfRegistRecommendData

 function lfRegistRecommendData($array, $arrRegistColumn)
 {
     // 仮登録
     foreach ($arrRegistColumn as $data) {
         if (strlen($array[$data["column"]]) > 0) {
             $arrRegist[$data["column"]] = $array[$data["column"]];
         }
     }
     $arrRegist['create_date'] = 'now()';
     $arrRegist['update_date'] = 'now()';
     $arrRegist['creator_id'] = '0';
     //-- 登録実行
     $objQuery = new SC_Query();
     $objQuery->begin();
     $objQuery->insert("dtb_review", $arrRegist);
     $objQuery->commit();
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:17,代码来源:LC_Page_Products_Review.php

示例14: sfSaveMailHistory

 function sfSaveMailHistory($order_id, $template_id, $subject, $body)
 {
     $sqlval['subject'] = $subject;
     $sqlval['order_id'] = $order_id;
     $sqlval['template_id'] = $template_id;
     $sqlval['send_date'] = "Now()";
     if (!isset($_SESSION['member_id'])) {
         $_SESSION['member_id'] = "";
     }
     if ($_SESSION['member_id'] != "") {
         $sqlval['creator_id'] = $_SESSION['member_id'];
     } else {
         $sqlval['creator_id'] = '0';
     }
     $sqlval['mail_body'] = $body;
     $objQuery = new SC_Query();
     $objQuery->insert("dtb_mail_history", $sqlval);
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:18,代码来源:SC_Helper_Mail.php

示例15: lfInsertClass

 function lfInsertClass()
 {
     $objQuery = new SC_Query();
     $objQuery->begin();
     // 親規格IDの存在チェック
     $where = "del_flg <> 1 AND class_id = ?";
     $ret = $objQuery->get("dtb_class", "class_id", $where, array($_POST['class_id']));
     if ($ret != "") {
         // INSERTする値を作成する。
         $sqlval['name'] = $_POST['name'];
         $sqlval['class_id'] = $_POST['class_id'];
         $sqlval['creator_id'] = $_SESSION['member_id'];
         $sqlval['rank'] = $objQuery->max("dtb_classcategory", "rank", $where, array($_POST['class_id'])) + 1;
         $sqlval['create_date'] = "now()";
         $sqlval['update_date'] = "now()";
         // INSERTの実行
         $ret = $objQuery->insert("dtb_classcategory", $sqlval);
     }
     $objQuery->commit();
     return $ret;
 }
开发者ID:khrisna,项目名称:eccubedrm,代码行数:21,代码来源:LC_Page_Admin_Products_ClassCategory.php


注:本文中的SC_Query::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。