company.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. $company = function()
  3. {
  4. $array = array();
  5. $data = Dever::db('manage/company')->state();
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. # 常用的col
  13. $col = '*';
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'company',
  18. # 显示给用户看的名称
  19. 'lang' => '期权公司配置',
  20. 'order' => -100,
  21. 'check' => 'company_id',
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => 'ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'list' => true,
  33. ),
  34. 'company_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '选择公司',
  38. 'default' => '',
  39. 'desc' => '公司名称',
  40. 'match' => 'is_numeric',
  41. 'update' => 'radio',
  42. 'list_name' => '公司名称',
  43. 'option' => $company,
  44. 'list' => true,
  45. 'search' => 'select',
  46. ),
  47. 'agreement_name' => array
  48. (
  49. 'type' => 'varchar-500',
  50. 'name' => '合同名称-变量说明:{name}是姓名,{date}签署时间',
  51. 'default' => '',
  52. 'desc' => '合同名称',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'option-company_qiquan'=> array
  59. (
  60. 'name' => '期权类型设置',
  61. 'default' => '',
  62. 'desc' => '期权类型设置',
  63. 'match' => 'option',
  64. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  65. 'sync' => array('id', 'company_id'),
  66. # 根据category字段的值,获取product/attr.search接口的内容
  67. 'update' => array(1),
  68. ),
  69. /*
  70. 'qiquan' => array
  71. (
  72. 'type' => 'text-1000',
  73. 'name' => '期权类型设置',
  74. 'default' => '',
  75. 'desc' => '期权类型设置',
  76. 'match' => 'is_string',
  77. 'update' => array
  78. (
  79. array
  80. (
  81. 'col' => 'name',
  82. 'name' => '类型名称',
  83. 'default' => '',
  84. 'desc' => '类型名称',
  85. 'match' => 'is_string',
  86. 'update' => 'textarea',
  87. ),
  88. ),
  89. ),
  90. */
  91. 'state' => array
  92. (
  93. 'type' => 'tinyint-1',
  94. 'name' => '状态',
  95. 'default' => '1',
  96. 'desc' => '请选择状态',
  97. 'match' => 'is_numeric',
  98. ),
  99. 'cdate' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '录入时间',
  103. 'match' => array('is_numeric', time()),
  104. 'desc' => '',
  105. # 只有insert时才生效
  106. 'insert' => true,
  107. 'list' => 'date("Y-m-d H:i", {cdate})',
  108. ),
  109. ),
  110. 'default' => array
  111. (
  112. 'col' => 'id,company_id,agreement_name, state,cdate',
  113. 'value' => array
  114. (
  115. '1, 1, "{name}期权交付合同.{date}.pdf", 1,' . DEVER_TIME,
  116. ),
  117. ),
  118. # 管理功能
  119. 'manage' => array
  120. (
  121. 'delete' => false,
  122. ),
  123. 'request' => array
  124. (
  125. 'getIds' => array
  126. (
  127. 'type' => 'all',
  128. 'option' => array
  129. (
  130. 'ids' => array('yes-id', 'in'),
  131. 'state' => 1,
  132. ),
  133. 'order' => array('id' => 'desc'),
  134. 'col' => '*|id',
  135. ),
  136. ),
  137. );