/**
* 添加注释指南
*
*/
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 appadminmodel;
use thinkModel;
class Useraddress extends Model
{
// 表名
protected $name = 'User_address';
protected $hidden=['id','delete_time','userid'];
}