You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
728 B
31 lines
728 B
<?php
|
|
|
|
namespace App\Service;
|
|
|
|
use App\Model\OrderMain;
|
|
use App\Model\User;
|
|
|
|
class UserService implements UserServiceInterface
|
|
{
|
|
|
|
/**
|
|
* 是否平台新用户
|
|
* 在很多奖励的地方会需要用到这个查询
|
|
* 判定条件:
|
|
* 没有在平台下过单(包括线上和线下)
|
|
* @param $user_id
|
|
* @return mixed|void
|
|
*/
|
|
public function isStageNewUser($user_id): bool
|
|
{
|
|
$exist = OrderMain::query()
|
|
->where(['user_id' => $user_id])
|
|
->where(function ($query){
|
|
$query->where('state', 'in', [4,5,10])
|
|
->orWhere('dm_state', 'in', [2,3]);
|
|
})
|
|
->exists();
|
|
|
|
return !$exist;
|
|
}
|
|
}
|