<?php /** * Created by PhpStorm. * User: 29925 * Date: 2018/8/6 * Time: 15:20 */ namespace app\admin\model; use think\Model; class OrderOptionModel extends Model { protected $autoWriteTimestamp = true; /** * 添加表单字段 */ public function addOption($data) { $this->allowField(true)->data($data,true)->isUpdate(false)->save(); return $this; } /** * 编辑表单字段 */ public function editOption($data) { $this->allowField(true)->data($data,true)->isUpdate(true)->save(); return $this; } }