瀏覽代碼

class通用函数整理

chenbo 5 年之前
父節點
當前提交
bebd86fdfb
共有 9 個文件被更改,包括 206 次插入232 次删除
  1. 18 28
      lib/day_k_base.class.php
  2. 21 19
      lib/index_csi300.class.php
  3. 21 22
      lib/index_gem.class.php
  4. 27 28
      lib/index_kc50.class.php
  5. 20 22
      lib/index_scz.class.php
  6. 23 27
      lib/index_sh.class.php
  7. 28 30
      lib/index_sh50.class.php
  8. 23 27
      lib/st_log.class.php
  9. 25 29
      lib/xrxd_log.class.php

+ 18 - 28
lib/day_k_base.class.php

@@ -8,13 +8,18 @@
  */
 class Day_k_base {
 
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_day_k_base = new Table_day_k_base();
+        return $Table_day_k_base->getInfoById($id);
+    }
+
 
-    /***
-     * @param $attrs
-     * @return mixed
-     * @throws Exception
-     * 添加股票的某一天数据信息
-     */
     static public function add($attrs,$date=0)
     {
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
@@ -25,6 +30,13 @@ class Day_k_base {
         $Table_day_k_base = new Table_day_k_base($date);
         $id = $Table_day_k_base->add($attrs);
         return $id;
+
+    }
+
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
+        $Table_day_k_base = new Table_day_k_base();
+        return $Table_day_k_base->getList($filter, $count, $page, $pageSize);
     }
 
     /***
@@ -46,27 +58,5 @@ class Day_k_base {
         return $id;
     }
 
-
-    /**
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
-
-        $Table_day_k_base = new Table_day_k_base();
-		return $Table_day_k_base->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_day_k_base = new Table_st_log();
-		return $Table_day_k_base->getList($filter, 1);
-	}
 }
 ?>

+ 21 - 19
lib/index_csi300.class.php

@@ -8,36 +8,38 @@
 
 class Index_csi300 {
 
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_csi300 = new Table_index_csi300();
+        return $Table_index_csi300->getInfoById($id);
+    }
+
     /****
      * @param $attrs
      * @return mixed
      * @throws Exception
      *
      */
-	static public function add($attrs){
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_csi300 = new Table_index_csi300();
         $id = $Table_index_csi300->add($attrs);
         return $id;
-	}
-
-    /****
-     * @param $page
-     * @param $pagesize
-     */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_index_csi300 = new Table_index_csi300();
-		return $Table_index_csi300->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-		$Table_index_csi300 = new Table_index_csi300();
-		return $Table_index_csi300->getList($filter, 1);
-	}
+        return $Table_index_csi300->getList($filter, $count, $page, $pageSize);
+    }
+
+
+
+
 }
 ?>

+ 21 - 22
lib/index_gem.class.php

@@ -7,39 +7,38 @@
  */
 class Index_gem {
 
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_gem = new Table_index_gem();
+        return $Table_index_gem->getInfoById($id);
+    }
+
+
     /***
      * @param $log
      * @return mixed
      * @throws Exception
      *
      */
-	static public function add($attrs){
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_gem = new Table_index_gem();
         $id = $Table_index_gem->add($attrs);
         return $id;
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_index_gem = new Table_index_gem();
-		return $Table_index_gem->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_index_gem = new Table_index_csi300();
-		return $Table_index_gem->getList($filter, 1);
-	}
+        return $Table_index_gem->getList($filter, $count, $page, $pageSize);
+    }
+
+
+
 }
 ?>

+ 27 - 28
lib/index_kc50.class.php

@@ -7,39 +7,38 @@
  */
 class Index_kc50 {
 
-	/**
-	 * 记录管理员日志
-	 * 
-	 * @param $log       日志内容
-	 * 
-	 */
-	static public function add($attrs){
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_kc50 = new Table_index_kc50();
+        return $Table_index_kc50->getInfoById($id);
+    }
+
+
+    /**
+     * 记录管理员日志
+     *
+     * @param $log       日志内容
+     *
+     */
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_kc50 = new Table_index_kc50();
         $id = $Table_index_kc50->add($attrs);
         return $id;
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_index_kc50 = new Table_index_kc50();
-		return $Table_index_kc50->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_index_gem = new Table_index_csi300();
-		return $Table_index_gem->getList($filter, 1);
-	}
+        return $Table_index_kc50->getList($filter, $count, $page, $pageSize);
+    }
+
+
+
 }
 ?>

+ 20 - 22
lib/index_scz.class.php

@@ -8,39 +8,37 @@
 
 class Index_scz {
 
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_scz = new Table_index_scz();
+        return $Table_index_scz->getInfoById($id);
+    }
+
     /****
      * @param $date
      * @return mixed
      * @throws Exception
      *
      */
-	static public function add($attrs){
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_scz = new Table_index_scz();
         $id = $Table_index_scz->add($attrs);
         return $id;
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_index_scz = new Table_index_scz();
-		return $Table_index_scz->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_index_gem = new Table_index_csi300();
-		return $Table_index_gem->getList($filter, 1);
-	}
+        return $Table_index_scz->getList($filter, $count, $page, $pageSize);
+    }
+
+
+
 }
 ?>

+ 23 - 27
lib/index_sh.class.php

@@ -8,39 +8,35 @@
 
 class Index_sh {
 
-	/**
-	 * 记录管理员日志
-	 * 
-	 * @param $log       日志内容
-	 * 
-	 */
-	static public function add($attrs){
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_sh = new Table_index_sh();
+        return $Table_index_sh->getInfoById($id);
+    }
+
+    /**
+     * 记录管理员日志
+     *
+     * @param $log       日志内容
+     *
+     */
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_sh = new Table_index_sh();
         $id = $Table_index_sh->add($attrs);
         return $id;
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_index_sh = new Table_index_sh();
-		return $Table_index_sh->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
+        return $Table_index_sh->getList($filter, $count, $page, $pageSize);
+    }
 
-        $Table_index_sh = new Table_index_sh();
-		return $Table_index_sh->getList($filter, 1);
-	}
 }
 ?>

+ 28 - 30
lib/index_sh50.class.php

@@ -8,39 +8,37 @@
 
 class Index_sh50 {
 
-	/**
-	 * 记录管理员日志
-	 * 
-	 * @param $log       日志内容
-	 * 
-	 */
-	static public function add($attrs){
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_index_sh50 = new Table_index_sh50();
+        return $Table_index_sh50->getInfoById($id);
+    }
+
+    /**
+     * 记录管理员日志
+     *
+     * @param $log       日志内容
+     *
+     */
+    static public function add($attrs){
         if (empty($attrs)) throw new Exception('参数不能为空', 102);
         $Table_index_sh50 = new Table_index_sh50();
         $id = $Table_index_sh50->add($attrs);
         return $id;
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
-
-        $Table_index_sh50 = new Table_index_sh();
-		return $Table_index_sh50->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_index_sh50 = new Table_index_sh();
-		return $Table_index_sh50->getList($filter, 1);
-	}
+    }
+
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
+        $Table_index_sh50 = new Table_index_sh50();
+        return $Table_index_sh50->getList($filter, $count, $page, $pageSize);
+    }
+
+
+
 }
 ?>

+ 23 - 27
lib/st_log.class.php

@@ -8,36 +8,32 @@
 
 class St_log {
 
-	/**
-	 * 记录管理员日志
-	 * 
-	 * @param $log       日志内容
-	 * 
-	 */
-	static public function add($log){
-
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    public function __construct()
+    {
+
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_st_log = new Table_st_log();
+        return $Table_st_log->getInfoById($id);
+    }
+
+
+    static public function add($attrs)
+    {
+        if (empty($attrs)) throw new Exception('参数不能为空', 101);
 
         $Table_st_log = new Table_st_log();
-		return $Table_st_log->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
+        $id = $Table_st_log->add($attrs);
+
+        return $id;
+    }
 
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_st_log = new Table_st_log();
-		return $Table_st_log->getList($filter, 1);
-	}
+        return $Table_st_log->getList($filter, $count, $page, $pageSize);
+    }
 }
 ?>

+ 25 - 29
lib/xrxd_log.class.php

@@ -8,36 +8,32 @@
 
 class Xrxd_log {
 
-	/**
-	 * 记录管理员日志
-	 * 
-	 * @param $log       日志内容
-	 * 
-	 */
-	static public function add($log){
-
-	}
-    
-	/** 
-	 * 管理员日志记录列表
-	 * 
-	 * @param $page        当前页
-	 * @param $pagesize    每页大小
-	 * 
-	 */
-	static public function getListByPage($page, $pagesize){
-		$filter = array();
+    public function __construct()
+    {
 
+    }
+
+    static public function getInfoById($id)
+    {
+        $Table_xrxd_log = new Table_xrxd_log();
+        return $Table_xrxd_log->getInfoById($id);
+    }
+
+
+    static public function add($attrs)
+    {
+        if (empty($attrs)) throw new Exception('参数不能为空', 101);
+
+        $Table_xrxd_log = new Table_xrxd_log();
+        $id = $Table_xrxd_log->add($attrs);
+
+        return $id;
+    }
+
+    static public function getList($filter = array(), $count=0, $page=0, $pageSize=0)
+    {
         $Table_xrxd_log = new Table_xrxd_log();
-		return $Table_xrxd_log->getList($filter, 0, $page, $pagesize);
-	}
-    
-	//管理员日志总数
-	static public function getCountAll(){
-		$filter = array();
-
-        $Table_xrxd_log = new Table_st_log();
-		return $Table_xrxd_log->getList($filter, 1);
-	}
+        return $Table_xrxd_log->getList($filter, $count, $page, $pageSize);
+    }
 }
 ?>