123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace App\Http\Controllers\App;
- use App\Handlers\Aes128Handler;
- use App\Jobs\TestJob;
- use App\Models\AdminUser;
- use App\Models\Area;
- use App\Models\AreaSetting;
- use App\Models\Bike;
- use App\Models\BoxBinding;
- use App\Models\LocationsLog;
- use App\Models\Parking;
- use App\Utils\Admin;
- use App\Utils\GaodeMaps;
- use App\Utils\RedisKeys;
- use Carbon\Carbon;
- use Illuminate\Support\Arr;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Log;
- use Intervention\Image\Facades\Image;
- class TestController extends AppBaseController
- {
- public function test()
- {
- // $id = Admin::user()->id;
- // $type = Admin::user()->type;
- // TestJob::dispatch(11111)->delay(Carbon::now()->addMinute());
- // return self::$areaIds;
- /* $park = Parking::all(['parking_centre']);
- $data = [];*/
- // $key = sprintf(RedisKeys::LOCK_RECEIVE_WORK,"A145454");
- // $res = app()->redis->incr($key);
- // app()->redis->Expire($key, RedisKeys::LOCK_EXPIRE_RECEIVE_WORK);
- // $res = GaodeMaps::getAddress(['lng'=>113.788364,'lat'=>34.784911]);
- // return $this->ok($res);
- // $res = base_path('blu.jar');
- // $bike_location = Bike::query()->pluck('last_location');
- // $arr = [];
- // foreach ($bike_location as $v){
- // $arr[] = json_decode($v);
- // }
- // $res = GaodeMaps::getAddressMany($arr);
- // $res = Aes128Handler::genKeyDocker('TBIT_WA205-7HBLE','003451248');
- // return $res ;
- // shell_exec('export PATH=$PATH:/var/www/jdk-13/bin');
- // shell_exec('cd /var/www');
- // $res = shell_exec('cd /var/www/jdk-13/bin; ./java -jar /var/www/weilaibike-admin/blu.jar TBIT_WA205-7HBLE 214');
- // $file = storage_path('app/public/qcode/t666.jpg');
- // $img = Image::make($file);
- // $img->colorize(0,0,100);
- // $img->save(storage_path('app/public/qcode/tttt666.jpg'));
- // return ;
- // $setting = AreaSetting::query()->where('area_id',14)->first();
- // $img = Image::make(storage_path('app/public/test1.png'));
- // $img->resize(35,35);
- // $img->save(storage_path('app/public/test1111.png'));
- // $img = Image::make(storage_path('app/public/ttt.png'));
- // $img->resize(15,15);
- // $img->save(storage_path('app/public/t2.png'));
- // $bike = Bike::query()->where('id','>',9)->get();
- // foreach ($bike as $v){
- // $bike_no = $v->bike_no;
- // $bike_no = str_replace('410','100',$bike_no);
- // $v->bike_no = $bike_no;
- // $v->save();
- // }
- // $bike->();
- // $bike = new Bike();
- // $bike->create(['bike_no'=>123456789]);
- //return $this->ok(Carbon::now()->addMinutes(10)->format('Y-m-d H:i:s'));
- // $bike = Bike::query()->get();
- // $num = count($bike);
- // $all = BoxBinding::query()->get()->toArray();
- // $count = count($all);
- // $a = config('wechat.payment.default.notify_url');
- // dd($a);
- //
- // $yesterday = Carbon::yesterday()->format('Ymd');
- // $last_month_yseterday = Carbon::yesterday()->subDays(6)->format('Ymd');
- ////dd($last_month_yseterday,$yesterday);
- // $app = app('wechat.mini_program');
- // $data = $app->data_cube->userPortrait($yesterday, $yesterday);
- // dd($last_month_yseterday,$yesterday,$data);
- $admin_id = Admin::user()->id;
- DB::enableQueryLog();
- $area_ids = AdminUser::getAreaIdsByAdminId($admin_id);
- Log::info(DB::getQueryLog());
- dd($area_ids);
- return $this->ok();
- }
- }
|