Pbargainlog.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * 砍价活动模型
  4. *
  5. */
  6. namespace app\common\model;
  7. use think\facade\Db;
  8. /**
  9. * ============================================================================
  10. *
  11. * ============================================================================
  12. *
  13. * ----------------------------------------------------------------------------
  14. *
  15. * ============================================================================
  16. * 数据层模型
  17. */
  18. class Pbargainlog extends BaseModel
  19. {
  20. public $page_info;
  21. /**
  22. * 获取开团表列表
  23. * @access public
  24. * @author csdeshang
  25. * @param type $condition 条件
  26. * @param type $pagesize 分页
  27. * @param type $order 排序
  28. * @return type
  29. */
  30. public function getPbargainlogList($condition, $pagesize = '', $order = 'pbargainlog_id desc')
  31. {
  32. if ($pagesize) {
  33. $res = Db::name('pbargainlog')->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
  34. $pbargainlog_list = $res->items();
  35. $this->page_info = $res;
  36. } else {
  37. $pbargainlog_list = Db::name('pbargainlog')->where($condition)->order($order)->select()->toArray();
  38. }
  39. return $pbargainlog_list;
  40. }
  41. /**
  42. * 获取单个单团信息
  43. * @access public
  44. * @author csdeshang
  45. * @param type $condition 条件
  46. * @return type
  47. */
  48. public function getOnePbargainlog($condition)
  49. {
  50. return Db::name('pbargainlog')->where($condition)->find();
  51. }
  52. /**
  53. * 插入砍价开团表
  54. * @access public
  55. * @author csdeshang
  56. * @param type $data 参数数据
  57. * @return type
  58. */
  59. public function addPbargainlog($data)
  60. {
  61. return Db::name('pbargainlog')->insertGetId($data);
  62. }
  63. }