Pbargainlog.php 1.6 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. class Pbargainlog extends BaseModel
  16. {
  17. public $page_info;
  18. /**
  19. * 获取开团表列表
  20. * @access public
  21. * @author csdeshang
  22. * @param type $condition 条件
  23. * @param type $pagesize 分页
  24. * @param type $order 排序
  25. * @return type
  26. */
  27. public function getPbargainlogList($condition, $pagesize = '', $order = 'pbargainlog_id desc')
  28. {
  29. if ($pagesize) {
  30. $res = Db::name('pbargainlog')->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
  31. $pbargainlog_list = $res->items();
  32. $this->page_info = $res;
  33. } else {
  34. $pbargainlog_list = Db::name('pbargainlog')->where($condition)->order($order)->select()->toArray();
  35. }
  36. return $pbargainlog_list;
  37. }
  38. /**
  39. * 获取单个单团信息
  40. * @access public
  41. * @author csdeshang
  42. * @param type $condition 条件
  43. * @return type
  44. */
  45. public function getOnePbargainlog($condition)
  46. {
  47. return Db::name('pbargainlog')->where($condition)->find();
  48. }
  49. /**
  50. * 插入砍价开团表
  51. * @access public
  52. * @author csdeshang
  53. * @param type $data 参数数据
  54. * @return type
  55. */
  56. public function addPbargainlog($data)
  57. {
  58. return Db::name('pbargainlog')->insertGetId($data);
  59. }
  60. }