diff --git a/app/command/HomeLocation.php b/app/command/HomeLocation.php index 1e0b151d..f7eb4681 100644 --- a/app/command/HomeLocation.php +++ b/app/command/HomeLocation.php @@ -1,66 +1,66 @@ -setName('HomeLocation') - ->setDescription('测试输出'); - } - - /** - * @notes:执行 - * @param Input $input - * @param Output $output - * @throws DataNotFoundException - * @throws DbException - * @throws ModelNotFoundException - * @author: wanghousheng - */ - protected function execute(Input $input, Output $output) - { - - $this->setHomeLocation(); - } - - public function setHomeLocation() - { - $model = new User(); - $dealerUser = Db::name('user')->where('homelocation','')->where('mobile','<>','') - ->distinct(true)->field('mobile')->select(); - foreach($dealerUser as $user){ - //$userMobiles = explode(',', $user['mobile']); - $localdate= UserService::getHomeLocation($user['mobile']); - // print_r( $localdate); - $localdate = json_decode($localdate,true); - // print_r( $localdate['data']); - $localdate = json_encode($localdate['data'],JSON_UNESCAPED_UNICODE); - // print_r( $localdate); - // exit; - $date = $model::where('mobile',$user['mobile'])->update(['homelocation'=>$localdate]); - var_dump($date); - - - } - - - } +setName('HomeLocation') + ->setDescription('测试输出'); + } + + /** + * @notes:执行 + * @param Input $input + * @param Output $output + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + * @author: wanghousheng + */ + protected function execute(Input $input, Output $output) + { + + $this->setHomeLocation(); + } + + public function setHomeLocation() + { + $model = new User(); + $dealerUser = Db::name('user')->where('homelocation','')->where('mobile','<>','') + ->distinct(true)->field('mobile')->select(); + foreach($dealerUser as $user){ + //$userMobiles = explode(',', $user['mobile']); + $localdate= UserService::getHomeLocation($user['mobile']); + // print_r( $localdate); + $localdate = json_decode($localdate,true); + // print_r( $localdate['data']); + $localdate = json_encode($localdate['data'],JSON_UNESCAPED_UNICODE); + // print_r( $localdate); + // exit; + $date = $model::where('mobile',$user['mobile'])->update(['homelocation'=>$localdate]); + var_dump($date); + + + } + + + } } \ No newline at end of file diff --git a/app/command/SprictTest.php b/app/command/SprictTest.php deleted file mode 100644 index c0e8292c..00000000 --- a/app/command/SprictTest.php +++ /dev/null @@ -1,66 +0,0 @@ -setName('SprictTest') - ->setDescription('测试输出'); - } - - /** - * @notes:执行 - * @param Input $input - * @param Output $output - * @throws DataNotFoundException - * @throws DbException - * @throws ModelNotFoundException - * @author: wanghousheng - */ - protected function execute(Input $input, Output $output) - { - - $this->setHomeLocation(); - } - - public function setHomeLocation() - { - $model = new User(); - $dealerUser = Db::name('user')->where('homelocation','')->where('mobile','<>','') - ->distinct(true)->field('mobile')->select(); - foreach($dealerUser as $user){ - //$userMobiles = explode(',', $user['mobile']); - $localdate= UserService::getHomeLocation($user['mobile']); - // print_r( $localdate); - $localdate = json_decode($localdate,true); - // print_r( $localdate['data']); - $localdate = json_encode($localdate['data'],JSON_UNESCAPED_UNICODE); - // print_r( $localdate); - // exit; - $date = $model::where('mobile',$user['mobile'])->update(['homelocation'=>$localdate]); - var_dump($date); - - - } - - - } -} \ No newline at end of file