fix some bugs from zarin

This commit is contained in:
2026-07-28 14:02:23 +03:30
parent 745f7fcfd6
commit 074b48de95
5 changed files with 315 additions and 90 deletions
@@ -35,9 +35,9 @@ return new class extends Migration
'type' => 'number',
],
'zarin_name_g' => [
'value' => '',
'value' => 'مشتری نقدی (خریدار)',
'title_fa' => 'نام گروه حساب مشتریان زرین',
'description' => 'پارامتر nameG در addhesab. اگر چند پنل یک توکن زرین دارند، برای هر پنل نام گروه متفاوت بگذارید. خالی = نام برند (name_fa).',
'description' => 'پارامتر nameG در addhesab — معادل گروه حساب در زرین. برای اپ خانگی: «مشتری نقدی (خریدار)» (گروه ۶). گروه همکار استفاده نشود چون مظنه فرق دارد.',
'type' => 'text',
],
'zarin_uid_prefix' => [
@@ -65,14 +65,24 @@ return new class extends Migration
continue;
}
// فقط متادیتا — value دست‌نخورده
DB::table('settings')->where('key', $key)->update([
// فقط متادیتا — value دست‌نخورده (به‌جز zarin_name_g خالی → گروه ۶)
$update = [
'title_fa' => $meta['title_fa'],
'description' => $meta['description'],
'type' => $meta['type'],
'can_edit' => 0,
'is_active' => 1,
]);
];
DB::table('settings')->where('key', $key)->update($update);
if ($key === 'zarin_name_g') {
DB::table('settings')
->where('key', $key)
->where(function ($q) {
$q->whereNull('value')->orWhereRaw("TRIM(value) = ''");
})
->update(['value' => $meta['value']]);
}
}
if (DB::table('settings')->where('key', 'accounting_provider')->exists()) {