BabyModel.php
582 字节
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/9/10
* Time: 9:46
*/
namespace app\admin\model;
use think\Model;
class BabyModel extends Model
{
protected $autoWriteTimestamp = true;
/**
* 添加宝宝年龄段
*/
public function addBaby($data) {
$this->allowField(true)->data($data,true)->isUpdate(false)->save();
return $this;
}
/**
* 编辑宝宝年龄段
*/
public function editBaby($data) {
$this->allowField(true)->data($data,true)->isUpdate(true)->save();
return $this;
}
}