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


PHP Course::select方法代码示例

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


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

示例1: deleteIfNotFound

 /**
  * If no training associations, delete course. 
  */
 public static function deleteIfNotFound($training_title_option_id, $training_id = 0)
 {
     $tableObj = new Course();
     $select = $tableObj->select()->from('training', array('COUNT(id) AS training_count'))->setIntegrityCheck(false)->where("course_id = {$training_title_option_id} AND id != {$training_id}");
     $row = $tableObj->fetchRow($select);
     if (!$row->training_count) {
         $tableObj = new Course();
         $tableObj->delete("training_title_option_id = {$training_title_option_id}");
         $tableObj = new ITechTable(array('name' => 'training_title_option'));
         $tableObj->delete("id = {$training_title_option_id}");
     }
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:15,代码来源:Course.php

示例2: Course

<?php

include_once $CFG->dirroot . "/lib/classes/" . "application/Course.Class.php5";
$courseObj = new Course();
$GeneralObj->getRequestVars();
$mode = $_REQUEST['mode'];
if ($mode == "Update") {
    $courseObj->select($iCourseId);
    $courseObj->getAllVar();
    if ($dCourseDateTime != "0000-00-00 00:00:00") {
        $iStarttime = date("H", strtotime($dCourseDateTime));
        $iStartTimeMM = date("i", strtotime($dCourseDateTime));
        $dCourseDateTime = substr($dCourseDateTime, 0, 10);
    }
    if ($iStarttime > 12) {
        $iStarttime = $iStarttime - 12;
        $SAMPM = "PM";
    } else {
        $SAMPM = "AM";
    }
} else {
    $mode = "Add";
}
if ($file != '') {
    $link = "index.php?file=" . $file . "&mode=" . $mode . "&listfile=" . $listfile;
}
$section = "Courses";
$TOP_HEADER = $mode . ' ' . $section;
if ($mode == 'Update') {
    $TOP_HEADER .= ' [' . $vCoursename . ']';
}
开发者ID:redeyes1024,项目名称:medlii_mlm_backend,代码行数:31,代码来源:courseadd.inc.php

示例3: sortDataCourseJson

 public function sortDataCourseJson()
 {
     ini_set('max_execution_time', 600000000);
     $listCourse = Course::select('id', 'name', 'desc', 'subject', 'word')->get();
     $size = count($listCourse);
     for ($i = 0; $i < $size; $i++) {
         $course = $listCourse[$i];
         $subject = Subject::where('id_course', $course->id)->count();
         $word = Word::where('id_course', $course->id)->count();
         Course::where('id', $course->id)->update(array('subject' => $subject, 'word' => $word));
     }
     try {
         $strListCourse = json_encode(Course::select('id', 'name', 'desc', 'subject', 'word', 'status', 'srclang', 'deslang')->where('status', 1)->get());
         $fileNameCourse = public_path() . '/AllData/courses.json';
         $fileCourse = fopen($fileNameCourse, "w");
         if (fwrite($fileCourse, $strListCourse)) {
             fclose($fileCourse);
             return Redirect::back()->with('notify', 'Xuất dữ liệu thành công');
         } else {
             fclose($fileCourse);
             return Redirect::back()->with('error', 'Có lỗi trong quá trình xuất dữ liệu');
         }
     } catch (Exception $e) {
         return Redirect::back()->with('error', 'Có lỗi trong quá trình xuất dữ liệu');
     }
 }
开发者ID:nguyensonghao,项目名称:api,代码行数:26,代码来源:WordController.php


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