thinkcmf5.1常用操作

系统函数

cmf_get_current_user()  //获取用户全部信息
cmf_get_current_user_id()  //获取登录用户ID(前台)
cmf_update_current_user()  //修改用户全部信息
cmf_get_current_admin_id() //(后台用户id)
cmf_get_domain() //获取当前域名
get_client_ip(0, true) //获取ip
cmf_password('你的新密码')//修改密码

状态信息 success error 返回

$this->success('添加成功');
$this->error('添加失败');

判断请求

$this->request->isPost()

判断查询到的数据是否为空

$order = Db::name('order')
      ->select();
if($order->isEmpty()){};

访问api文件

https://XXXXX/api.php/portal/articles/index
发布了65 篇原创文章 · 获赞 20 · 访问量 2105

猜你喜欢

转载自blog.csdn.net/weixin_43993175/article/details/103972359
5.1