|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
namespace App\Console\Commands\Sync;
|
|
|
|
|
|
|
|
use App\Models\Manage\Manage;
|
|
|
|
use App\Models\Manage\Mobile;
|
|
|
|
use App\Models\User\User;
|
|
|
|
use Illuminate\Console\Command;
|
|
...
|
...
|
@@ -60,7 +61,7 @@ class SyncMobile extends Command |
|
|
|
];
|
|
|
|
$mobileModel->insert($param);
|
|
|
|
//查看当前用户是否存在
|
|
|
|
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>1]);
|
|
|
|
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>1],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$data = [
|
|
|
|
'mobile'=>$mobile,
|
|
...
|
...
|
@@ -73,6 +74,9 @@ class SyncMobile extends Command |
|
|
|
}
|
|
|
|
}
|
|
|
|
$data[] = '13083988828';
|
|
|
|
$managerModel = new Manage();
|
|
|
|
$mobileArr = $managerModel->selectField(['status'=>1],'mobile');
|
|
|
|
$data = array_values(array_unique(array_merge($data,$mobileArr)));
|
|
|
|
$userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]);
|
|
|
|
$userModel->edit(['status'=>0],['project_id'=>1,'mobile'=>['in',$data]]);
|
|
|
|
}
|
...
|
...
|
|