2020-06-10 13:32:32 +08:00

57 lines
1.3 KiB
PHP

<?php
namespace wstmart\app\controller;
class Note extends Base
{
public function index(){
$userId = (int)session('WST_USER.userId');
}
public function detail(){
$userId = (int)session('WST_USER.userId');
if(($id = (int)input( 'id', 0)) > 0){
return WSTReturn("", 1, [
"id"=>$id,
"create_time"=>"昨天",
"title"=>"标题",
"content"=>"内容",
]);
}
return WSTReturn("异常请求",0);
}
public function save(){
$userId = (int)session('WST_USER.userId');
$id = (int)input( 'post.id', 0);
$title = input("post.title");
$content = input("post.content");
if(empty($title)) return WSTReturn("请填写标题",0);
if(empty($content)) return WSTReturn("请填写内容",0);
if($id > 0){
return WSTReturn("成功", 1);
}elseif($id == 0){
return WSTReturn("成功", 1);
}
return WSTReturn("异常请求",0);
}
public function creditIndex(){
$userId = (int)session('WST_USER.userId');
}
public function creditDetail(){
}
public function creditCreate(){
}
public function creditAdd(){
}
}