store extra.order_desk_print_template
parent
ded66d9f0c
commit
23b1cb079f
|
|
@ -54,6 +54,10 @@ class DeviceController extends AdminController
|
|||
$form->switch('status')->default(1);
|
||||
$form->text('remarks');
|
||||
|
||||
$form->embeds('extra', function (Form\EmbeddedForm $form) {
|
||||
$form->text('order_desk_print_template', '桌号订单打印模板')->default('a4fcc59f40fd438d9afdd4fc2e9b99fc');
|
||||
});
|
||||
|
||||
$form->disableCreatingCheck();
|
||||
$form->disableEditingCheck();
|
||||
$form->disableDeleteButton();
|
||||
|
|
@ -71,7 +75,7 @@ class DeviceController extends AdminController
|
|||
{
|
||||
return Show::make($id, Device::with(['store']), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('store_id');
|
||||
$show->field('store_id')->as(fn() => data_get($this->store, 'title'));
|
||||
$show->field('name');
|
||||
$show->field('device_no');
|
||||
$show->field('status')->bool();
|
||||
|
|
|
|||
|
|
@ -98,10 +98,12 @@ class StoreController extends AdminController
|
|||
$show->field('remarks');
|
||||
$show->field('created_at');
|
||||
|
||||
$show->field('order_desk_print_template')->as(fn() => data_get($this->extra, 'order_desk_print_template'));
|
||||
|
||||
$show->tools(function (Tools $tools) {
|
||||
$tools->append(new ExportGoodsSpu());
|
||||
|
||||
$tools->disableList();
|
||||
// $tools->disableList();
|
||||
$tools->disableDelete();
|
||||
$tools->disableEdit();
|
||||
});
|
||||
|
|
@ -141,6 +143,10 @@ class StoreController extends AdminController
|
|||
$form->switch('status')->default(1);
|
||||
$form->number('sort')->min(1)->default(1);
|
||||
|
||||
$form->embeds('extra', function (Form\EmbeddedForm $form) {
|
||||
$form->text('order_desk_print_template', '桌号订单打印模板')->default('a4fcc59f40fd438d9afdd4fc2e9b99fc');
|
||||
});
|
||||
|
||||
$form->disableDeleteButton();
|
||||
$form->footer(function ($footer) {
|
||||
$footer->disableEditingCheck();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class OrderPrint
|
|||
|
||||
// 门店设备
|
||||
$devices = $store->devices()->where('status', 1)->get();
|
||||
$templateId = app_settings('custom.key_value.order_desk_print_template');
|
||||
$templateId = data_get($store->extra, 'order_desk_print_template');
|
||||
if ($devices->count() > 0 && $templateId) {
|
||||
$service = PrintService::make();
|
||||
$products = [];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddExtraToStores extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('stores', function (Blueprint $table) {
|
||||
$table->json('extra')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('stores', function (Blueprint $table) {
|
||||
$table->dropColumn('extra');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ class StoreDeviceSeeder extends Seeder
|
|||
{
|
||||
Device::truncate();
|
||||
DeviceRecord::truncate();
|
||||
(new StoreDeviceFactory())->count(10)->create();
|
||||
(new StoreDeviceRecordFactory())->count(100)->create();
|
||||
// (new StoreDeviceFactory())->count(10)->create();
|
||||
// (new StoreDeviceRecordFactory())->count(100)->create();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ return [
|
|||
'sell_price' => '销售价格',
|
||||
'vip_price' => '会员价格',
|
||||
'specs' => '规格',
|
||||
'extra' => '其他',
|
||||
'order_desk_print_template' => '桌号订单打印模板',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue