|
|
@@ -11,10 +11,14 @@
|
|
11
|
11
|
namespace app\common\model\store\order;
|
|
12
|
12
|
|
|
13
|
13
|
|
|
|
14
|
+use app\common\enum\CommonEnum;
|
|
|
15
|
+use app\common\enum\shared\SharedProsperityRewardRecordEnum;
|
|
14
|
16
|
use app\common\model\BaseModel;
|
|
|
17
|
+use app\common\model\shared\SharedProsperityRewardRecord;
|
|
15
|
18
|
use app\common\model\store\service\StoreService;
|
|
16
|
19
|
use app\common\model\system\merchant\Merchant;
|
|
17
|
20
|
use app\common\model\user\User;
|
|
|
21
|
+use app\common\model\user\UserPvLog;
|
|
18
|
22
|
use app\common\repositories\store\MerchantTakeRepository;
|
|
19
|
23
|
|
|
20
|
24
|
class StoreOrder extends BaseModel
|
|
|
@@ -71,4 +75,17 @@ class StoreOrder extends BaseModel
|
|
71
|
75
|
{
|
|
72
|
76
|
return getModelTime($query, $value);
|
|
73
|
77
|
}
|
|
|
78
|
+
|
|
|
79
|
+ public function userPvLog()
|
|
|
80
|
+ {
|
|
|
81
|
+ return $this->hasOne(UserPvLog::class, 'order_id', 'order_id')->where('order_type', '=', CommonEnum::ORDER_TYPE['Platform']['code']);
|
|
|
82
|
+ }
|
|
|
83
|
+
|
|
|
84
|
+ public function sharedProsperityRewardRecord()
|
|
|
85
|
+ {
|
|
|
86
|
+ return $this->hasOne(SharedProsperityRewardRecord::class, 'order_sn', 'order_sn')
|
|
|
87
|
+ ->where('type_shop', '=', SharedProsperityRewardRecordEnum::TYPE_SHOP['Platform']['code'])
|
|
|
88
|
+ ->where('type', '=', SharedProsperityRewardRecordEnum::TYPE['PV']['code'])
|
|
|
89
|
+ ->where('pm', '=', SharedProsperityRewardRecordEnum::PM['INCOME']['code']);
|
|
|
90
|
+ }
|
|
74
|
91
|
}
|