zoukankan      html  css  js  c++  java
  • 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 appadminmodel;

    use thinkModel;

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

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

    }

  • 相关阅读:
    C++ unordered_set运用实例
    C++ Multimap运用实例—查找元素
    C++ Multimap运用实例
    C++ Map运用实例
    C++ Set运用实例
    C++ list运用实例
    C++ vector使用实例
    c++ Array运用实例
    C++ int double float对应的长度以及二进制
    引用和指针有什么区别
  • 原文地址:https://www.cnblogs.com/vip-deng-vip/p/9448757.html
Copyright © 2011-2022 走看看