product.php 2.5 KB

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