123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- /**
- * @author: CeeFee
- * @description: 学期
- */
- class SSemester extends ModelA {
- public function __construct()
- {
- parent::__construct();
- }
-
- public function getCurrentSemester()
- {
- return $this->conn->createQuery()
- ->from('semester')
- ->where("status = '1'")
- ->limit(1)
- ->query()
- ->read();
- }
- public function getSemester($semid){
- return $this->conn->createQuery()
- ->from('semester')
- ->where("semester_id = {$semid}")
- ->limit(1)
- ->query()
- ->read();
- }
-
- public function getCodeByExamId($examId){
- $code = 0;
- $sql = "select s.status,s.refer_code from exam e join semester s on e.semester_id = s.semester_id where e.exam_id = '{$examId}'";
- $data = $this->conn->createQuery($sql)->queryRow();
- if($data && $data['status'] != 1){
- $code = $data['refer_code']?$data['refer_code']:0;
- }
- return $code;
-
- }
- }
|