product.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'product',
  6. # 显示给用户看的名称
  7. 'lang' => '电商产品',
  8. 'order' => 100,
  9. 'menu' => false,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. 'list' => true,
  21. ),
  22. 'info_id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '合集',
  26. 'default' => '',
  27. 'desc' => '合集',
  28. 'match' => 'is_numeric',
  29. 'update' => 'hidden',
  30. 'value' => Dever::input('search_option_info_id')
  31. ),
  32. 'goods_id' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '选择商品',
  36. 'default' => '',
  37. 'desc' => '选择商品',
  38. 'match' => 'option',
  39. 'update' => 'select',
  40. 'update_search' => 'goods/lib/manage.search',
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-180',
  45. 'name' => '商品标题',
  46. 'default' => '',
  47. 'desc' => '商品标题',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'pic_cover' => array
  54. (
  55. 'type' => 'varchar-150',
  56. 'name' => '商品图片-图片尺寸随意或等比尺寸,建议尺寸660*660px,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  57. 'default' => '',
  58. 'desc' => '商品图片',
  59. 'match' => 'is_string',
  60. 'update' => 'image',
  61. 'key' => '1',
  62. 'place' => '660*660',
  63. ),
  64. 'price' => array
  65. (
  66. 'type' => 'varchar-50',
  67. 'name' => '售价-只是用来展示,可以带上单位',
  68. 'default' => '',
  69. 'desc' => '售价',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. 'list' => true,
  73. ),
  74. 'reorder' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '排序(数值越大越靠前)',
  78. 'default' => '1',
  79. 'desc' => '请输入排序',
  80. 'match' => 'option',
  81. 'update' => 'text',
  82. 'search' => 'order',
  83. 'list' => true,
  84. 'order' => 'desc',
  85. 'edit' => true,
  86. ),
  87. 'state' => array
  88. (
  89. 'type' => 'tinyint-1',
  90. 'name' => '状态',
  91. 'default' => '1',
  92. 'desc' => '请选择状态',
  93. 'match' => 'is_numeric',
  94. ),
  95. 'cdate' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '录入时间',
  99. 'match' => array('is_numeric', time()),
  100. 'desc' => '',
  101. # 只有insert时才生效
  102. 'insert' => true,
  103. ),
  104. ),
  105. # 管理功能
  106. 'manage' => array
  107. (
  108. ),
  109. # request 请求接口定义
  110. 'request' => array
  111. (
  112. 'getAll' => array
  113. (
  114. # 匹配的正则或函数 选填项
  115. 'option' => array
  116. (
  117. 'info_id' => 'yes',
  118. 'state' => 1,
  119. ),
  120. 'type' => 'all',
  121. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  122. 'page' => array(10, 'list'),
  123. 'col' => '*',
  124. ),
  125. ),
  126. );