|
|
@@ -19,28 +19,28 @@ class LlUserClass extends BaseClass
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- public static function replaceUser($user,$shop)
|
|
|
+ public static function replaceUser($userInfo,$shop)
|
|
|
{
|
|
|
$shopId = $shop->id??'';
|
|
|
$shopMobile = $shop->mobile??'';
|
|
|
$shopFullName = $shop->merchantName.' '.$shop->shopName;
|
|
|
$userId = 0;
|
|
|
$baseId = 0;
|
|
|
- $date = $user['date'] ?? '';
|
|
|
- $name = $user['name'] ?? '';
|
|
|
- $no = $user['no'] ?? '';
|
|
|
+ $thatDate = $userInfo['date'] ?? '';
|
|
|
+ $name = $userInfo['name'] ?? '';
|
|
|
+ $no = $userInfo['no'] ?? '';
|
|
|
$noRes = LlNoClass::getByCondition(['no' => $no], true);
|
|
|
if (!empty($noRes)) {
|
|
|
$userId = $noRes->userId ?? 0;
|
|
|
$baseId = $noRes->baseId ?? 0;
|
|
|
}
|
|
|
- $mobile = $user['mobile'] ?? '';
|
|
|
+ $mobile = $userInfo['mobile'] ?? '';
|
|
|
$mobileRes = LlMobileClass::getByCondition(['mobile' => $mobile], true);
|
|
|
if (!empty($mobileRes) && empty($userId)) {
|
|
|
$userId = $mobileRes->userId ?? 0;
|
|
|
$baseId = $mobileRes->baseId ?? 0;
|
|
|
}
|
|
|
- $wx = $user['wx'] ?? '';
|
|
|
+ $wx = $userInfo['wx'] ?? '';
|
|
|
$wxRes = LlWxClass::getByCondition(['wx' => $wx], true);
|
|
|
if (!empty($wxRes) && empty($userId)) {
|
|
|
$userId = $wxRes->userId ?? 0;
|
|
|
@@ -50,7 +50,9 @@ class LlUserClass extends BaseClass
|
|
|
if (!empty($userId)) {
|
|
|
$user = self::getById($userId, true);
|
|
|
} else {
|
|
|
- $user = self::add($user, true);
|
|
|
+ $userInfo['firstDate'] = $thatDate;
|
|
|
+ $userInfo['lastDate'] = $thatDate;
|
|
|
+ $user = self::add($userInfo, true);
|
|
|
}
|
|
|
|
|
|
if (!empty($baseId)) {
|
|
|
@@ -68,12 +70,11 @@ class LlUserClass extends BaseClass
|
|
|
if (!empty($no)) {
|
|
|
$base = LlBaseClass::getByCondition(['no' => $no], true);
|
|
|
if (empty($base)) {
|
|
|
- $baseData = ['no' => $no, 'name' => $name,];
|
|
|
+ $baseData = ['no' => $no, 'name' => $name,'firstDate'=>$thatDate,'lastDate'=>$thatDate];
|
|
|
$base = LlBaseClass::add($baseData, true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
$userId = $user->id ?? 0;
|
|
|
$baseId = $base->id ?? 0;
|
|
|
if (!empty($wx)) {
|