Pbargainlog.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * 砍价活动模型
  4. *
  5. */
  6. namespace app\common\model;
  7. use think\facade\Db;
  8. /**
  9. * ============================================================================
  10. *
  11. * ============================================================================
  12. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  13. * 网站地址: https://www.valimart.net/
  14. * ----------------------------------------------------------------------------
  15. *
  16. * ============================================================================
  17. * 数据层模型
  18. */
  19. class Pbargainlog extends BaseModel {
  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. if($pagesize){
  32. $res = Db::name('pbargainlog')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  33. $pbargainlog_list = $res->items();
  34. $this->page_info = $res;
  35. }else{
  36. $pbargainlog_list = Db::name('pbargainlog')->where($condition)->order($order)->select()->toArray();
  37. }
  38. return $pbargainlog_list;
  39. }
  40. /**
  41. * 获取单个单团信息
  42. * @access public
  43. * @author csdeshang
  44. * @param type $condition 条件
  45. * @return type
  46. */
  47. public function getOnePbargainlog($condition){
  48. return Db::name('pbargainlog')->where($condition)->find();
  49. }
  50. /**
  51. * 插入砍价开团表
  52. * @access public
  53. * @author csdeshang
  54. * @param type $data 参数数据
  55. * @return type
  56. */
  57. public function addPbargainlog($data)
  58. {
  59. return Db::name('pbargainlog')->insertGetId($data);
  60. }
  61. }