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


PHP BaseModel::executeSimpleQuery方法代码示例

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


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

示例1: actionDetails

 public function actionDetails($id)
 {
     $visit = Visits::model()->findByPk($id);
     $visit_sql = "SELECT d.solicitor_id,d.user_id,d.visit_id,s.first_name,s.last_name,v.visit_code, CASE WHEN v.status = 1 THEN 'Yes' ELSE 'No' END AS visit_active, v.start_date,v.end_date, SUM( d.amount ) AS amount FROM `user_donation` d LEFT JOIN visits v ON d.visit_id = v.id LEFT JOIN solicitor s ON d.solicitor_id = s.id WHERE d.visit_id = '{$id}' GROUP BY d.visit_id";
     $visits = BaseModel::executeSimpleQuery($visit_sql);
     // pre($visits,true);
     $donation = new Donation('users');
     $donation->unsetAttributes();
     $payments = new SolicitorCredit('solicitor');
     $payments->unsetAttributes();
     $this->render('donations', array('visit' => $visit->visit_code, 'visits' => $visits, 'donation' => $donation, 'payments' => $payments));
 }
开发者ID:priyranjansingh,项目名称:donation,代码行数:12,代码来源:VisitsController.php

示例2: actionDonations

 public function actionDonations($id)
 {
     $visit_sql = "SELECT d.user_id,d.visit_id,s.first_name,s.last_name,v.visit_code, CASE WHEN v.status = 1 THEN 'Yes' ELSE 'No' END AS visit_active, v.start_date,v.end_date, SUM( d.amount ) AS amount FROM `user_donation` d LEFT JOIN visits v ON d.visit_id = v.id LEFT JOIN solicitor s ON d.solicitor_id = s.id WHERE s.id = '{$id}' GROUP BY d.visit_id ORDER BY d.date_entered DESC";
     $visits = BaseModel::executeSimpleQuery($visit_sql);
     $c_sql = "SELECT SUM(amount) AS amount FROM solicitor_credit WHERE solicitor_id = '{$id}'";
     $c_result = BaseModel::executeSimpleQueryFirstRow($c_sql);
     if ($c_result === null) {
         $amount = 0;
     } else {
         $amount = $c_result['amount'];
     }
     $d_sql = "SELECT SUM(amount) AS amount FROM user_donation WHERE solicitor_id = '{$id}'";
     $d_result = BaseModel::executeSimpleQueryFirstRow($d_sql);
     if ($d_result === null) {
         $damount = 0;
     } else {
         $damount = $d_result['amount'];
     }
     $solicitor = Solicitor::model()->findByPk($id);
     $donation = new Donation('users');
     $donation->unsetAttributes();
     $payments = new SolicitorCredit('solicitor');
     $payments->unsetAttributes();
     $this->render('donations', array('visits' => $visits, 'donation' => $donation, 'solicitor' => $solicitor, 'amount' => $amount, 'damount' => $damount, 'payments' => $payments));
 }
开发者ID:priyranjansingh,项目名称:donation,代码行数:25,代码来源:SolicitorController.php

示例3: getBrowsers

 public function getBrowsers()
 {
     $sql = "SELECT id,browser FROM log GROUP BY browser";
     return $result = BaseModel::executeSimpleQuery($sql);
 }
开发者ID:priyranjansingh,项目名称:donation,代码行数:5,代码来源:Log.php


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