|
|
@@ -355,8 +355,11 @@ sql
|
|
|
*/
|
|
|
public function deleteAuthority($owner)
|
|
|
{
|
|
|
- Authority::query()->where('name',"_{$owner['id']}")
|
|
|
+ $authorities = Authority::query()->where('name',"_{$owner['id']}")
|
|
|
->where("alias_name","like","(货主%")
|
|
|
- ->delete();
|
|
|
+ ->get(["id"]);
|
|
|
+ $ids = array_column($authorities->toArray(),"id");
|
|
|
+ DB::table("authority_role")->whereIn("id_authority",$ids)->delete();
|
|
|
+ Authority::destroy($ids);
|
|
|
}
|
|
|
}
|