稻虾流向增加单位
parent
94aa0656ed
commit
81abd7270d
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\OperationType;
|
||||
use App\Http\Requestes\RiceShrimpFlowStoreRequest;
|
||||
use App\Http\Requestes\RiceShrimpFlowUpdateRequest;
|
||||
use App\Http\Resources\RiceShrimpFlowResource;
|
||||
use App\Models\RiceShrimpFlow;
|
||||
use App\Services\OperationLogService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use App\Services\OperationLogService;
|
||||
use App\Enums\OperationType;
|
||||
|
||||
class RiceShrimpFlowController extends Controller
|
||||
{
|
||||
|
|
@ -48,6 +48,7 @@ class RiceShrimpFlowController extends Controller
|
|||
'quarter',
|
||||
'area',
|
||||
'sales',
|
||||
'unit',
|
||||
])
|
||||
);
|
||||
$riceShrimpFlow->created_by = $user->id;
|
||||
|
|
@ -80,6 +81,7 @@ class RiceShrimpFlowController extends Controller
|
|||
'quarter',
|
||||
'area',
|
||||
'sales',
|
||||
'unit',
|
||||
] as $key) {
|
||||
if ($request->filled($key)) {
|
||||
$riceShrimpFlow->{$key} = $request->input($key);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class RiceShrimpFlowStoreRequest extends FormRequest
|
|||
'quarter' => ['required', new Quarter()],
|
||||
'area' => ['required', 'string'],
|
||||
'sales' => ['required', 'int', 'min:0'],
|
||||
'unit' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -29,6 +30,7 @@ class RiceShrimpFlowStoreRequest extends FormRequest
|
|||
'quarter' => '季度',
|
||||
'area' => '地区',
|
||||
'sales' => '销量',
|
||||
'unit' => '单位',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class RiceShrimpFlowUpdateRequest extends FormRequest
|
|||
'quarter' => ['filled', new Quarter()],
|
||||
'area' => ['filled', 'string'],
|
||||
'sales' => ['filled', 'int', 'min:0'],
|
||||
'unit' => ['filled', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -29,6 +30,7 @@ class RiceShrimpFlowUpdateRequest extends FormRequest
|
|||
'quarter' => '季度',
|
||||
'area' => '地区',
|
||||
'sales' => '销量',
|
||||
'unit' => '单位',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class RiceShrimpFlowResource extends JsonResource
|
|||
'quarter' => $this->quarter,
|
||||
'area' => $this->area,
|
||||
'sales' => $this->sales,
|
||||
'unit' => $this->unit,
|
||||
'created_by' => AdminUserResource::make($this->whenLoaded('createdBy')),
|
||||
'updated_by' => AdminUserResource::make($this->whenLoaded('updatedBy')),
|
||||
'created_at' => $this->created_at->unix(),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class RiceShrimpFlow extends Model
|
|||
'quarter',
|
||||
'area',
|
||||
'sales',
|
||||
'unit',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ return new class extends Migration
|
|||
$table->tinyInteger('quarter')->comment('季度');
|
||||
$table->string('area')->comment('地区');
|
||||
$table->unsignedBigInteger('sales')->comment('销量');
|
||||
$table->string('unit')->comment('单位');
|
||||
$table->unsignedBigInteger('created_by')->comment('创建人ID');
|
||||
$table->unsignedBigInteger('updated_by')->comment('修改人ID');
|
||||
$table->timestamps();
|
||||
|
|
|
|||
Loading…
Reference in New Issue