@@ -427,16 +427,14 @@ public static function valueMap($model, $fieldKey, $fieldValue, $where = [])
427427 }
428428
429429 /**
430- *
431430 * 关联表列出关联信息
432431 *
433- * @param $model : 表名称
434- * @param $sourceField : 外键列名
435- * @param $sourceValue : 外键值
436- * @param array $filter : 关联过滤条件
437- * @param array $extraFields : 额外返回字段
438- * @param string $idField : 关系表ID列名
439- *
432+ * @param $model string 表名称
433+ * @param $sourceField string 外键列名
434+ * @param $sourceValue mixed 外键值
435+ * @param $filter array 关联过滤条件
436+ * @param $extraFields array 额外返回字段
437+ * @param $idField string 关系表ID列名
440438 * @return array
441439 */
442440 public static function relationList ($ model , $ sourceField , $ sourceValue , $ filter = [], $ extraFields = [], $ idField = 'id ' )
@@ -445,16 +443,27 @@ public static function relationList($model, $sourceField, $sourceValue, $filter
445443 }
446444
447445 /**
448- *
446+ * 关联表清除
447+ * @param $model string 表名称
448+ * @param $field string 外键列名
449+ * @param $value mixed 外键值
450+ * @return int
451+ */
452+ public static function relationClean ($ model , $ field , $ value )
453+ {
454+ return self ::model ($ model )->where ($ field , $ field )->delete ();
455+ }
456+
457+ /**
449458 * 关系表关联操作
450459 *
451- * @param $model : 表名称
452- * @param $sourceField : 外键列名
453- * @param $sourceValue : 外键值
454- * @param $targetField : 关联列名
455- * @param $targetValues : 关联列值
456- * @param array $filter : 关联过滤条件
457- * @param string $idField : 关系表ID列名
460+ * @param $model string 表名称
461+ * @param $sourceField string 外键列名
462+ * @param $sourceValue mixed 外键值
463+ * @param $targetField string 关联列名
464+ * @param $targetValues array 关联列值
465+ * @param $filter array 关联过滤条件
466+ * @param $idField string 关系表ID列名
458467 *
459468 * @example
460469 *
0 commit comments