delete(); } $data['goods_id'] = $goodsId; $data['uniacid'] = \YunShop::app()->uniacid; $model->setRawAttributes($data); return $model->save(); } public static function getModel($goodsId, $operate) { $model = false; if ($operate != 'created') { $model = static::where(['goods_id' => $goodsId])->first(); } if (!$model) { $model = new static; } return $model; } }