fastadmin 接口(上传)


/**
* 添加注释指南
*
*/

public function store(Request $request)
{
dump($request);exit;
$name = $request->param('name');
$content = $request->param('content');
$cover = $request->param('cover');
$video = $request->param('video');

$comment = new ApparatusModel();
$comment->name = $name;
$comment->content = $content;
$comment->cover = $cover;
$comment->video = $video;
$comment->add_time = date('Y-m-d H:i:s', time());
$comment->save();

$this->success();


}

 

=====================

public function share(Request $request)
{
//获取openid
$openid = $request->user->openid;

//查询之前邀请中人数
$invited_num = Trainer::where('openid',$openid)->value('invited_num')+1;
$result = Trainer::where('openid',$openid)->update(['invited_num'=>$invited_num]);
//返回数据
$this->success($result);
}

 

----------

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/6/23
* Time: 15:34
*/

namespace app\admin\model;

use think\Model;

class Useraddress extends Model
{
// 表名
protected $name = 'User_address';

protected $hidden=['id','delete_time','userid'];

 

}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM