ProductAudit.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Admin\Forms;
  3. use App\Admin\Repositories\BaseProductCategory;
  4. use App\Admin\Repositories\RpcAlbum;
  5. use App\Libraries\CommonHelper;
  6. use App\Models\BaseProduct;
  7. use App\Models\BaseProductImage;
  8. use Dcat\Admin\Widgets\Form;
  9. class ProductAudit extends Form
  10. {
  11. public function title()
  12. {
  13. return 'Copy';
  14. }
  15. /**
  16. * Handle the form request.
  17. *
  18. * @param array $input
  19. *
  20. * @return mixed
  21. */
  22. public function handle(array $input)
  23. {
  24. $id = $this->payload['id'] ?? null;
  25. return $this
  26. ->response()
  27. ->success('导入成功')
  28. ->refresh();
  29. }
  30. /**
  31. * Build a form here.
  32. */
  33. public function form()
  34. {
  35. // 设置隐藏表单,传递用户id
  36. $this->select('category_id', admin_trans_label('category_name'))
  37. ->options(BaseProductCategory::selectOptions())
  38. ->required();
  39. $this->hidden('album_ids')->attribute('id', 'album_ids');
  40. }
  41. /**
  42. * The data of the form.
  43. *
  44. * @return array
  45. */
  46. public function default()
  47. {
  48. return [];
  49. }
  50. }