1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| <?php
| namespace app\api\model\plus\business;
|
| use app\common\model\plus\business\Order as BaseOrder;
|
| class Order extends BaseOrder
| {
| /**
| * 检查用户是否已购买名片
| */
| public function checkCardPurchase($userId, $businessCardId)
| {
| if (!$userId) {
| return false;
| }
|
| // 查询购买记录
| $count = $this
| ->where('user_id', '=', $userId)
| ->where('business_card_id', '=', $businessCardId)
| ->where('pay_status', '=', 20) // 20表示已支付
| ->count();
|
| return $count > 0;
| }
| }
|
|