ProductPvDao.php 583 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\common\dao\profit;
  3. use app\common\dao\BaseDao;
  4. use app\common\model\profit\ProductPvModel;
  5. class ProductPvDao extends BaseDao
  6. {
  7. protected function getModel(): string
  8. {
  9. return ProductPvModel::class;
  10. }
  11. /**
  12. * @param $productId
  13. * @return mixed
  14. * 获取商品业绩
  15. */
  16. public function getData($productId = 0)
  17. {
  18. $where = [];
  19. if($productId != 0) {
  20. $where['product_id'] = $productId;
  21. }
  22. return $this->getModel()::getDB()->where($where)->column('pv','product_id');
  23. }
  24. }