product.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. return [
  3. "field" => [
  4. '产品名称' => [
  5. 'key' =>'title',
  6. 'rule' =>'',
  7. 'other_rule' => 'require|unique:Product',
  8. ],
  9. '产品分类' => [
  10. 'key' =>'product_category_id',
  11. 'db_search' => [
  12. 'db_name' => 'ProductCategory',
  13. 'key' => 'title',
  14. 'value' => 'id',
  15. ],
  16. 'other_rule' => 'require',
  17. ],
  18. '产品编码' => [
  19. 'key' =>'code',
  20. 'rule' => '',
  21. 'other_rule' => 'require|unique:Product',
  22. ],
  23. '产品SN编码' => [
  24. 'key' =>'sn_code',
  25. 'rule' => '',
  26. 'other_rule' => 'require|unique:Product',
  27. ],
  28. '规格' => [
  29. 'key' =>'size',
  30. 'rule' =>'',
  31. 'other_rule' => '',
  32. ],
  33. '单位' => [
  34. 'key' =>'unit',
  35. 'rule' =>'',
  36. 'other_rule' => '',
  37. 'db_search' => [
  38. 'db_name' => 'BasicType',
  39. 'key' => 'title',
  40. 'value' => 'id',
  41. ],
  42. ],
  43. '条码' => [
  44. 'key' =>'bar_code',
  45. 'rule' =>'',
  46. 'other_rule' => '',
  47. ],
  48. '成本' => [
  49. 'key' =>'cost',
  50. 'rule' =>'',
  51. 'other_rule' => 'require|is_numeric',
  52. ],
  53. '零售价' => [
  54. 'key' =>'retail_price',
  55. 'rule' =>'',
  56. 'other_rule' => 'is_numeric',
  57. ],
  58. ],
  59. //(特殊) 额外表头字段数组名 因为一般这个数据理论上是无限的 所以放在子表里 结构是数组
  60. "dynamics_field" => [
  61. "name" => "basic_type_22",
  62. "func" => "productTitle",
  63. ],
  64. "other_field_func" => "fillInsertProductData",// (特殊)需要填充的其它字段 这里是为了前端组件渲染的数据
  65. "table" => [
  66. "Product" => [
  67. "field" => ["title","product_category_id","code","size","unit","bar_code","cost","retail_price","crt_id","mark","sn_code","crt_time","depart_id","top_depart_id"],
  68. ],
  69. "ProductPriceDetail" => [
  70. "field_array" => [
  71. "basic_type_22" => [
  72. "product_id","basic_type_id","price","crt_time"
  73. ],
  74. ],
  75. "need_param" => "product_id",
  76. "db_name" => "Product",
  77. "db_key" => "id",
  78. ],
  79. ],
  80. ];