| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\common\dao\store\order;
- use app\common\dao\BaseDao;
- use app\common\model\store\order\OldUserOfGoods;
- class OldUserOfGoodsDao extends BaseDao
- {
- protected function getModel(): string
- {
- return OldUserOfGoods::class;
- }
- /**
- * @param $userId
- * @param $price
- * @return array
- * 获取业绩
- */
- public function getPv($userId, $price)
- {
- $model = $this->getModel();
- $oldPvData = $model::getDB()
- ->whereIn('user_id', $userId)
- ->whereIn('money', $price)
- ->where('status', 1)
- ->group('money')
- ->field('money,count(1) as count')
- ->select()
- ->toArray();
- return array_column($oldPvData,'count','money');
- }
- }
|