whereIn('id', $row['city'])->column('name'); return $cityNames ? implode(',', $cityNames) : ''; } public function getRequireItemAttr($value): array { if ($value === '' || $value === null) return []; if (!is_array($value)) { return explode(',', $value); } return $value; } public function setRequireItemAttr($value): string { return is_array($value) ? implode(',', $value) : $value; } public function getPrepayAmountAttr($value): float { return (float)$value; } public function getPrepayImageAttr($value): array { if ($value === '' || $value === null) return []; if (!is_array($value)) { return explode(',', $value); } return $value; } public function setPrepayImageAttr($value): string { return is_array($value) ? implode(',', $value) : $value; } public function getSettleAmountAttr($value): float { return (float)$value; } public function department() { return $this->belongsTo(\app\admin\model\department\Department::class, 'req_corp', 'id'); } public function admin() { return $this->belongsTo(\app\admin\model\Admin::class, 'req_user_id', 'id'); } public function supplier() { return $this->belongsTo(\app\admin\model\Supplier::class, 'supplier_id', 'id'); } }