thinkphp调用当前控制器类中的其他方法的小示例ThinkPHP教程

/ / 2016-10-11   阅读:2558
public function get_all_month_time(){         $order_steplogs=M("order_steplogs")->db(1);//工单步骤表           $min_time1=$order_steplogs->where(...
public function get_all_month_time(){
        $order_steplogs=M("order_steplogs")->db(1);//工单步骤表
 
        $min_time1=$order_steplogs->where("time1 > 0 ")->Min("time1");//得到最小发单时间
        $cur_month_time["end_time"]=$min_time1;
        $now=time();
        $month_time=array();
        while ($cur_month_time["end_time"] < $now) {
            $cur_month_time=$this->getmonth($cur_month_time["end_time"]+1);
            $month_time[]=$cur_month_time;
        }
        return $month_time;//返回值 
    }

public function Summary(){
$month_time=$this->get_all_month_time();//调用当前类中的get_all_month_time()方法
}
//可以使用$this-> 来调用当前类中的某个方法
跨模块的调用可以用A方法

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈