table_xrxd_log.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * 数据库表:管理员组
  4. *
  5. * @createtime 2018/03/01
  6. * @author 空竹
  7. * @copyright 芝麻开发(http://www.zhimawork.com)
  8. */
  9. class Table_xrxd_log extends Table {
  10. protected $table_name = 'xrxd_log';//表名,不带前缀,前缀在config中定义
  11. protected $table_id = 'xrxd_log_id';//指定ID字段名称,必须
  12. protected $table_status = '';//指定状态字段名称,如果有
  13. protected $table_order = '';//指定排序字段名称,如果有
  14. //数据库结构
  15. protected function struct(){
  16. $attr = array();
  17. $attr['id'] = 'xrxd_log_id';
  18. $attr['date'] = 'xrxd_log_date';
  19. $attr['code'] = 'xrxd_log_code';
  20. $attr['name'] = 'xrxd_log_name';
  21. $attr['type'] = 'xrxd_log_type';
  22. $attr['multiple'] = 'xrxd_log_multiple';
  23. $attr['subprice'] = 'xrxd_log_subprice';
  24. return $attr;
  25. }
  26. public function add($attr){
  27. $param = array (
  28. 'xrxd_log_date' => array('number', $attr['date']),
  29. 'xrxd_log_code' => array('string', $attr['code']),
  30. 'xrxd_log_name' => array('string', $attr['name']),
  31. 'xrxd_log_type' => array('string', $attr['type']),
  32. 'xrxd_log_multiple' => array('number', $attr['multiple']),
  33. 'xrxd_log_subprice' => array('number', $attr['subprice']),
  34. );
  35. return $this->pdo->sqlinsert($this->table_fullname, $param);
  36. }
  37. }
  38. ?>