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


PHP CommonModel::findOne方法代码示例

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


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

示例1: 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

示例2: 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

示例3: switch

 switch ($v['ebay_carrier']) {
     case "SurePost":
         $Track_website = "www.ups.com";
         break;
     case "UPS":
         $Track_website = "www.ups.com";
         break;
     case "USPS":
         $Track_website = "www.usps.com";
         break;
     default:
         $Track_website = "";
 }
 //根据跟踪号长度获取对应回复内容模板
 if (strlen($v['ebay_tracknumber']) == 31) {
     $trackTempl = $tpl_obj->findOne('*', " WHERE `id` = '41' AND `is_delete` = 0");
     //Letter模板
 } else {
     $trackTempl = $tpl_obj->findOne('*', " WHERE `id` = '40' AND `is_delete` = 0");
 }
 //处理模板内容
 $buyer_id = $v['ebay_userid'];
 $seller_id = $v['ebay_account'];
 $trackNum = isset($v['ebay_tracknumber']) ? $v['ebay_tracknumber'] : '';
 $item_id = isset($v['ebay_itemid']) ? $v['ebay_itemid'] : '';
 $content = $trackTempl['content'];
 $content = str_replace('{buyer}', $buyer_id, $content);
 $content = str_replace('{tracknum}', $trackNum, $content);
 $content = str_replace('{url}', "<a href ='{$Track_website}'>" . $Track_website . '</a>', $content);
 $content = str_replace("&", "&amp;", $content);
 $returnData['itemid'] = $item_id;
开发者ID:ohjack,项目名称:newErp,代码行数:31,代码来源:sendEbayOverseaMail.php


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