|
|
@@ -54,11 +54,6 @@ class TestController extends Controller
|
|
|
$respond = MobileSnClass::add(['id' => null], true);
|
|
|
$newMobile = $respond->id;
|
|
|
|
|
|
- $admin = AdminClass::getByCondition(['mobile' => $mobile], true);
|
|
|
- if (!empty($admin)) {
|
|
|
- $admin->mobile = $newMobile;
|
|
|
- $admin->save();
|
|
|
- }
|
|
|
$staffList = StaffClass::getAllByCondition(['mobile' => $mobile], null, '*', null, true);
|
|
|
if (!empty($staffList)) {
|
|
|
foreach ($staffList as $staff) {
|
|
|
@@ -114,9 +109,16 @@ class TestController extends Controller
|
|
|
$user->save();
|
|
|
}
|
|
|
}
|
|
|
+ $adminList = AdminClass::getAllByCondition(['mobile' => $mobile], null, '*', null, true);
|
|
|
+ if (!empty($adminList)) {
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $admin->mobile = $newMobile;
|
|
|
+ $admin->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$transaction->commit();
|
|
|
- echo $mobile . ' ' . $newMobile;
|
|
|
- die;
|
|
|
+ echo $mobile . ' ' . $newMobile . "\n";
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
$msg = $e->getMessage();
|