|
|
@@ -3,9 +3,11 @@
|
|
|
namespace console\controllers;
|
|
|
|
|
|
use biz\admin\classes\AdminClass;
|
|
|
+use biz\ghs\classes\GhsClass;
|
|
|
use biz\shop\classes\ShopAdminClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
+use bizGhs\custom\classes\CustomClass;
|
|
|
use bizHd\saas\classes\ApplyClass;
|
|
|
use common\components\util;
|
|
|
use yii\console\Controller;
|
|
|
@@ -33,7 +35,32 @@ class SjController extends Controller
|
|
|
if (!empty($merchantName)) {
|
|
|
SjClass::deleteByCondition(['name' => $merchantName]);
|
|
|
}
|
|
|
+ $sjId = $shop->sjId ?? 0;
|
|
|
$shop->delete();
|
|
|
+ if (!empty($sjId)) {
|
|
|
+ $ghsList = GhsClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
|
|
|
+ if (!empty($ghsList)) {
|
|
|
+ foreach ($ghsList as $ghs) {
|
|
|
+ $customId = $ghs->customId;
|
|
|
+ $ghs->delete();
|
|
|
+ $current = CustomClass::getById($customId, true);
|
|
|
+ if (!empty($current)) {
|
|
|
+ $current->delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $customList = CustomClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
|
|
|
+ if (!empty($customList)) {
|
|
|
+ foreach ($customList as $custom) {
|
|
|
+ $ghsId = $custom->ghsId;
|
|
|
+ $custom->delete();
|
|
|
+ $current = GhsClass::getById($ghsId, true);
|
|
|
+ if (!empty($current)) {
|
|
|
+ $current->delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
ApplyClass::deleteByCondition(['mobile' => $mobile]);
|