Goodscollect.php 775 字节
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/5/11
 * Time: 14:33
 */

namespace app\index\model;


use think\Model;

class Goodscollect extends Model
{
    public function insertData($data){
        $result = $this->insert($data);
        return $result;
    }
    public function updateData($where,$data){
        $result = $this->where($where)->update($data);
        return $result;
    }
    public function findData($where){
        $data = $this->where($where)->find();
        return $data;
    }
    public function deleteData($where){
        $result = $this->where($where)->delete();
        return $result;
    }

    public function goods() {
        return $this->belongsTo('Goods','goods_id','id',[],'LEFT')->setEagerlyType(0);
    }
}