|
|
@@ -21,8 +21,7 @@ class SjService extends BaseService
|
|
|
|
|
|
public static $baseFile = '\bizHd\merchant\classes\SjClass';
|
|
|
|
|
|
-
|
|
|
- public static function initHdBaseInfo($applyData, $main, $applyThis = false)
|
|
|
+ public static function initHdBaseInfo($applyData, $main, $applyOpen = false)
|
|
|
{
|
|
|
$applyId = $applyData['id'] ?? 0;
|
|
|
$adminId = $applyData['adminId'] ?? 0;
|
|
|
@@ -43,20 +42,21 @@ class SjService extends BaseService
|
|
|
$applyData['dist'] = $applyData['dist'] ?? '';
|
|
|
$applyData['address'] = $applyData['address'] ?? '';
|
|
|
$applyData['agentLevel'] = 1;
|
|
|
- $applyData['parentId'] = $applyData['introSjId'] ?? 0;
|
|
|
$deadline = time() + 365 * 86400;
|
|
|
$applyData['deadline'] = date("Y-m-d H:i:s", $deadline);
|
|
|
- $applyData['parentId'] = $applyData['introSjId'] ?? 0;
|
|
|
- $applyData['parentShopId'] = $applyData['introShopId'] ?? 0;
|
|
|
+ if ($applyOpen) {
|
|
|
+ $applyData['parentId'] = $applyData['introSjId'] ?? 0;
|
|
|
+ $applyData['parentShopId'] = $applyData['introShopId'] ?? 0;
|
|
|
+ }
|
|
|
|
|
|
$jsData = $applyData;
|
|
|
- $sjData['style'] = dict::getDict('ptStyle', 'hd');
|
|
|
+ $sjData['style'] = $ptStyle;
|
|
|
$sj = self::add($jsData, true);
|
|
|
$sjId = $sj->id;
|
|
|
$sjName = $sj->name ?? 0;
|
|
|
$mobile = $applyData['mobile'] ?? '';
|
|
|
|
|
|
- if (!empty($applyId) && $applyThis == true) {
|
|
|
+ if (!empty($applyId) && $applyOpen == true) {
|
|
|
ApplyClass::updateById($applyId, ['sjId' => $sjId]);
|
|
|
}
|
|
|
|
|
|
@@ -138,7 +138,7 @@ class SjService extends BaseService
|
|
|
SjClass::updateById($sjId, $sjData);
|
|
|
|
|
|
//建立供应商和客户关系
|
|
|
- if ($applyThis) {
|
|
|
+ if ($applyOpen) {
|
|
|
CustomService::shareBuildTrade($applyData, $shopInfo);
|
|
|
}
|
|
|
|