ChannelModel.php 574 字节
<?php
/**
 * Created by PhpStorm.
 * User: 29925
 * Date: 2018/8/12
 * Time: 9:16
 */

namespace app\admin\model;

use think\Model;

class ChannelModel extends Model
{

    protected $autoWriteTimestamp = true;

    /**
     * 添加渠道
     */
    public function addChannel($data) {
        $this->allowField(true)->data($data,true)->isUpdate(false)->save();
        return $this;
    }

    /**
     * 编辑渠道
     */
    public function editChannel($data) {
        $this->allowField(true)->data($data,true)->isUpdate(true)->save();
        return $this;
    }
}