當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonModel::transSafetySql方法代碼示例

本文整理匯總了PHP中CommonModel::transSafetySql方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonModel::transSafetySql方法的具體用法?PHP CommonModel::transSafetySql怎麽用?PHP CommonModel::transSafetySql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonModel的用法示例。


在下文中一共展示了CommonModel::transSafetySql方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: view_submitEditData

 public function view_submitEditData()
 {
     $tid = isset($_POST['tid']) ? intval($_POST['tid']) : 0;
     $name = isset($_POST['title']) ? trim($_POST['title']) : '';
     $subject = isset($_POST['topic']) ? trim($_POST['topic']) : '';
     $content = isset($_POST['content']) ? trim($_POST['content']) : '';
     $countries = isset($_POST['country']) ? $_POST['country'] : false;
     $tpl_obj = new CommonModel('msg_ebaycstpl');
     $tplRel_obj = new CommonModel('msg_ebaycsrel');
     $tplInfo = $tpl_obj->findOne('*', " where id='{$tid}' ");
     if (empty($tplInfo)) {
         $msgdata = array('data' => array('不存在的模板!'), 'link' => 'index.php?mod=messageTemplate&act=showEbayTplList');
         goErrMsgPage($msgdata);
         exit;
     }
     $tpl_obj->updateData(array('name' => $name, 'subject' => $subject, 'content' => $content, 'updateTime' => time()), " where id='{$tid}'");
     $countries = CommonModel::transSafetySql($countries);
     $tplRel_obj->updateData(array('tplId' => 0), " where tplId='{$tid}'");
     $contrySql = implode("', '", $countries);
     $tplRel_obj->updateData(array('tplId' => $tid), " where countryCode in ('{$contrySql}')");
     $msgdata = array('data' => array('執行成功!'), 'link' => 'index.php?mod=messageTemplate&act=showEbayTplList');
     goOkMsgPage($msgdata);
     exit;
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:24,代碼來源:amazonMessageTemplate.view.php

示例2: view_sendCsMail

 public function view_sendCsMail()
 {
     $returnData = array('code' => 'fail', 'msg' => '', 'itemid' => '');
     $itemId = isset($_GET['itemId']) ? trim($_GET['itemId']) : '';
     //ItemId
     $buyerId = isset($_GET['userId']) ? trim($_GET['userId']) : '';
     //買家id
     $seller = isset($_GET['account']) ? trim($_GET['account']) : '';
     //賣家ID
     $contryCode = isset($_GET['country']) ? trim($_GET['country']) : '';
     //國家代碼
     $buytime = isset($_GET['paidTime']) ? intval($_GET['paidTime']) : '';
     //購買時間
     $returnData['itemid'] = $itemId;
     if (empty($itemId) || empty($contryCode)) {
         $returnData['msg'] = '缺少參數';
         echo json_encode($returnData);
         exit;
     }
     $ecm_obj = new EbayCsMailManageModel();
     $v_result = $ecm_obj->validateSend($buyerId, $seller, $buytime, $itemId);
     //驗證是否需要發送
     if (!$v_result) {
         $returnData['msg'] = '無需發送';
         $returnData['code'] = 'noneed';
         echo json_encode($returnData);
         exit;
     }
     $tokenFile = WEB_PATH . 'lib/ebaylibrary/keys/keys_' . $seller . ".php";
     //         echo $tokenFile;exit;
     if (!file_exists($tokenFile)) {
         $returnData['code'] = 'fail';
         $returnData['msg'] = '沒找到賬號token!';
         echo json_encode($returnData);
         exit;
     }
     include $tokenFile;
     /*----- 導出為全局變量 ugly code -----*/
     $GLOBALS['siteID'] = $siteID;
     $GLOBALS['production'] = $production;
     $GLOBALS['compatabilityLevel'] = $compatabilityLevel;
     $GLOBALS['devID'] = $devID;
     $GLOBALS['appID'] = $appID;
     $GLOBALS['certID'] = $certID;
     $GLOBALS['serverUrl'] = $serverUrl;
     $GLOBALS['userToken'] = $userToken;
     /*----- 導出為全局變量 -----*/
     $tpl_obj = new CommonModel('msg_ebaycstpl');
     $tplRel_obj = new CommonModel('msg_ebaycsrel');
     $country = CommonModel::transSafetySql(array($contryCode));
     $contryCode = $country[0];
     $row = $tplRel_obj->findOne('*', "where countryCode='{$contryCode}'");
     if (empty($row)) {
         $returnData['code'] = 'fail';
         $returnData['msg'] = '未找到國家代碼!';
         echo json_encode($returnData);
         exit;
     }
     $tplID = $row['tplId'];
     $tplInfo = $tpl_obj->findOne('*', " where id='{$tplID}'");
     if (!$tplInfo) {
         $returnData['code'] = 'fail';
         $returnData['msg'] = '沒設置模板!';
         echo json_encode($returnData);
         exit;
     } else {
         $returnData['tplId'] = $tplID;
     }
     $result = $ecm_obj->sendEbayCsMail($itemId, $buyerId, $tplInfo['content'], $tplInfo['subject']);
     //         $result = TRUE;
     if (FALSE === $result) {
         $returnData['code'] = 'fail';
         $returnData['msg'] = EbayCsMailManageModel::$errMsg;
         echo json_encode($returnData);
         exit;
     } else {
         $returnData['code'] = 'success';
         $returnData['msg'] = '處理成功!';
         echo json_encode($returnData);
     }
 }
開發者ID:ohjack,項目名稱:newErp,代碼行數:81,代碼來源:interFace.view.php


注:本文中的CommonModel::transSafetySql方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。