admin store-device.deposit

main
panliang 2024-04-25 11:44:43 +08:00
parent 80bec8fe4a
commit 72022a8c0f
5 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,7 @@ class DeviceController extends AdminController
amisMake()->TableColumn()->name('store.title')->label(__('store_device.store_id')),
amisMake()->TableColumn()->name('name')->label(__('store_device.name')),
amisMake()->TableColumn()->name('code')->label(__('store_device.code')),
amisMake()->TableColumn()->name('deposit')->label(__('store_device.deposit')),
amisMake()->TableColumn()->name('remarks')->label(__('store_device.remarks')),
amisMake()->TableColumn()->name('created_at')->label(__('store_device.created_at')),
$this->rowActions([
@ -61,6 +62,7 @@ class DeviceController extends AdminController
->required(),
amisMake()->TextControl()->name('name')->label(__('store_device.name'))->required(),
amisMake()->TextControl()->name('code')->label(__('store_device.code'))->required(),
amisMake()->NumberControl()->name('deposit')->label(__('store_device.deposit'))->min(0)->precision(2)->default(0),
amisMake()->TextControl()->name('remarks')->label(__('store_device.remarks')),
]);
}

View File

@ -19,6 +19,7 @@ class StoreDeviceService extends BaseService
$createRules = [
'name' => ['required'],
'code' => ['required'],
'deposit' => ['decimal:12,2'],
];
$updateRules = [];
$validator = Validator::make($data, $model ? $updateRules : $createRules, [

View File

@ -14,7 +14,7 @@ class StoreDevice extends Model
use Filterable;
use HasDateTimeFormatter;
protected $fillable = ['store_id', 'name', 'code', 'remarks'];
protected $fillable = ['store_id', 'name', 'code', 'remarks', 'deposit'];
public function store()
{

View File

@ -16,6 +16,7 @@ return new class extends Migration
$table->foreignId('store_id')->comment('关联门店, stores.id');
$table->string('name')->comment('设备名称');
$table->string('code')->comment('编号');
$table->decimal('deposit', 12, 2)->default(0)->comment('押金');
$table->string('remarks')->nullable()->comment('备注');
$table->timestamps();
$table->comment('彩票机管理');

View File

@ -8,4 +8,5 @@ return [
'store_id' => '门店',
'name' => '名称',
'code' => '编号',
'deposit' => '押金',
];