VideoModel.php 569 字节
<?php
/**
 * Created by PhpStorm.
 * User: 29925
 * Date: 2018/8/20
 * Time: 16:25
 */

namespace app\admin\model;

use think\Model;

class VideoModel extends Model
{

    protected $autoWriteTimestamp = true;

    /**
     * 添加视频
     */
    public function addVideo($data) {
        $this->allowField(true)->data($data,true)->isUpdate(false)->save();
        return $this;
    }

    /**
     * 编辑视频
     */
    public function editVideo($data) {
        $this->allowField(true)->data($data,true)->isUpdate(true)->save();
        return $this;
    }
}