zoukankan      html  css  js  c++  java
  • ThinkPHP5日志

    //一、定义一个日志的方法
       public function clolog($str){
         $name=Session::get('uid');
         $this->assign("name",$name);
         $time = date('Y-m-d H:i:s');
         //组织成键值对
         $data = [
                'name'=>$name,
                'time'=>$time,
                'str'=>$str,
            ];
        $data = Db::table('log')->insert($data);    
       }

    二、调用

     $this->clolog("添加商品分类成功!");

    三、

    <?php
    namespace appindexcontroller;
    use thinkController;
    use thinkDb;
    use thinkSession;
    class Clolog extends Common{
        //日志
        function clolog(){
            $list = Db::name('log')->paginate(5,false,
                [
                    'type'=>'BootstrapDetailed'
                ]
                );
            $this->assign('list', $list);
            return $this->fetch();
        }
    }

  • 相关阅读:
    MSER
    resize和reserve的区别
    Rect
    U盘文件或目录损坏且无法读取怎么解决
    信道估计
    ann
    仿射变换详解 warpAffine
    opencv新版本的数据结构
    大津法
    php红包
  • 原文地址:https://www.cnblogs.com/sccwxl/p/10007772.html
Copyright © 2011-2022 走看看