method, $this->secret_key, $this->options, $this->iv); } public function three() { $users = User::query()->get(); foreach ($users as $u) { } $d = User::query()->get(); dd($d); $u = User::query()->where(['raw' => 5])->first(); dd($u); $records = User::query()->where(['dd' => 111])->get(); dd($records->toArray()); $records = []; $data = User::query()->where(['id' => 1])->first(); dd($data); $user = User::query()->first(); $userList = $user->limit(1)->get(); foreach ($userList as $item) { $a = 1; } // $a = 'https://www.pinterest.com/vanshao86/api-demo/'; // // $res = substr(preg_replace('/(http|https):\/\/www.pinterest.com\//i', '', $a), 0, -1); // dd($res); $social = Social::query()->where(['site_id' => 1, 'type' => 'pin'])->first(); $pin = new Pinterest($social->app_id, $social->app_secret); $pin->auth->setOAuthToken($social->token); try { $pin->pins->create([ "note" => time() . 'hello', "image_url" => "http://wall.yinqingli.com/storage/social/Y5bUoajNFpNGVN2yIw3FvU8mzu18jgCAkkTN9w1I.jpg", "board" => "hinaqin/api-demo", 'link' => 'http://www.sohu.com' ]); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } dd('success'); // $boards = $pin->users->getMeBoards(); $results = []; foreach ($boards as $item) { // $results[] = substr(preg_replace('/(http|https):\/\/www.pinterest.com\//i', '', $a), 0, -1); } dd($results); // // "url" => "https://www.pinterest.com/hinaqin/" // "first_name" => "hina" // "last_name" => "qin" // "id" => "844988086243903392" // $me = $pin->users->me(); // dump($me); $state = $pin->auth->getState(); dump($state); // $boards = $pin->users->getMeBoards(); // dump($boards); // $boardDetail=$pin->boards->get("hina qin/api-demo"); // dump($boardDetail); try { $pin->pins->create([ "note" => "Test board from API", "image_url" => "http://admin.yinqingli.com/storage/201906/jpg/1Q987Ryl6mdPFhJljhy5O1EhPol9M79dSVFbGnod.jpeg", "board" => "hinaqin/api-demo" ]); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } dd('success'); error_log(file_get_contents('php://input')); return '3'; } public function four() { dd("hello"); dd($this->facebook()); // $uploaded_media = Twitter::uploadMedia(['media' => File::get(public_path('filename.jpg'))]); // return Twitter::postTweet(['status' => 'Laravel is beautiful', 'media_ids' => $uploaded_media->media_id_string]); $uploaded_media = Twitter::uploadMedia(['media' => File::get(public_path('filename.jpg'))]); Twitter::postTweet(['status' => 'Laravel is beautiful', 'media_ids' => $uploaded_media->media_id_string]); dd($this->twitter()); } public function five() { $this->linked(); } public function linked() { $img = 'http://admin.yinqingli.com/storage/201906/jpg/1Q987Ryl6mdPFhJljhy5O1EhPol9M79dSVFbGnod.jpeg'; $token = 'AQUOiNxK2Fn0fEwbqCzeo26xT-CFp_DO57GJ1Hqf9XoD1zezGa1knRuENJyu7RtJTjQhSS3UZ_winzcHsxHxm_nWE0pJUclmN21BMsTmiYnqA_i2mjo8l26ZjZ0Y0Qn2umh0aGqt5XGVw9_YY5HkHmy_5JUjGQb7SMpdEO1mobEyb9CK0L5-jPcLAfmwLDRrap3KeeOIdu3i8EgPKzJG8dNqmcsbHuA1Gnq3WX1kXtBtKmnd1KzPxGbQSK9-V_txzz3VhdsRs6CFqoZrWdZjcxngkN26etQg6cG58Il1f7W7PVS8SKjpyC6rzIAEN9ee00dp3EvyfckcJDZTtYbojr-HUnmw_Q'; LinkedinShare::shareArticle($token, 'http://www.baidu.com', 'LinkedInShare', 'accessToken'); dd('success'); } public function pin() { $pin = new Pinterest(config('services.pinterest.client_id'), config('services.pinterest.client_secret')); $pin->auth->setOAuthToken('AsityC1Rl6-kSqfwD98akYNaj5gxFatL7qHFJjNF8JCvpODAwAu6ADAAAUegRfKs6higoeEAAAAA'); dump($pin->getRateLimitRemaining()); try { $pin->pins->create([ "note" => "Test board from API", "image_url" => "http://admin.yinqingli.com/storage/201906/jpg/1Q987Ryl6mdPFhJljhy5O1EhPol9M79dSVFbGnod.jpeg", "board" => "hinaqin/api-demo" ]); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } } public function twitter() { error_reporting(E_ALL); ini_set('display_errors', 1); $consumerKey = 'QfqLozpNfcbXp042lMmQtFQbE'; $consumerSecret = 'rI4crlFCxprr2DtbA9BygpymuiClkG6hKArU7C6uuyuKEfpAi2'; $accessToken = '4296714074-8HUSqvOOfHRAnq880OQu3X36pZu69ltPOkddwYK'; $accessTokenSecret = 'bxtLHmfZkfYj2GlNcoPLgMKjvmd23ad8hmZTI4IJCQbVM'; // $path = 'http://admin.yinqingli.com/storage/201906/jpg/1Q987Ryl6mdPFhJljhy5O1EhPol9M79dSVFbGnod.jpeg'; $path = public_path('profile_small.jpg'); try { $twitter = new \DG\Twitter\Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); dd($twitter->send('this is sixth demo from api', [$path, public_path('demo-head.png')], ['possibly_sensitive' => false])); } catch (\TwitterException $e) { dd($e->getMessage()); } dd('success'); } public function HelloWorld() { $fn = function ($b) use (&$fn) { return 1; }; $fn(1); return response()->json(['message' => '操作成功'], 400); } public function ins() { $taskUrls = ['http://www.baidu.com', 'http://www.sohu.com']; $client = new Client([ 'verify' => false, 'timeout' => 10 ]); //并发请求链接地址 $requests = function () use ($taskUrls) { foreach ($taskUrls as $item) { yield new \GuzzleHttp\Psr7\Request('GET', $item); } }; $pool = new Pool($client, $requests(), [ 'concurrency' => 10, //同时并发抓取几个 'fulfilled' => function (Response $response, $index) { }, 'rejected' => function (\Throwable $throwable, $index) { Log::error(var_export($throwable->getMessage(), 1)); }, ]); $promise = $pool->promise(); $promise->wait(); } public function facebook() { //// User::query()->where(['']) // $testUserToken = 'EAAiLLRwuSRgBAAxxqmoMpiNlC0haZBUctZAIFSng5NZADyY6MPZAXxsWG37MjI9yZB3i5edKZAp3UvvhzCJ88L3ZA3g5hnsGkPgEUeDwo9TAZA5ZC4SYzqBMFjt97a5EgqqkKZBRHiYJacqHVPlntvxdTBn9au9xhZBhkuy2shESAb5TWvf5CwKSbJk'; // // // 发布到pages // try { // $fb = new Facebook([ // 'app_id' => '2404825676269848', // 'app_secret' => 'e4387c50b2e0388baa547f60f85aa8f9', // 'default_access_token' => $testUserToken, // optional // ]); // // } catch (\Throwable $throwable) { // // } // // $fb->setDefaultAccessToken($testUserToken); // // $linkData = [ // 'link' => 'http://www.baidu.com', //TODO change // 'message' => 'hello i m vae', // ]; // $pageId = '2822252084511458'; //// $pageId = '688544178276351'; // $response = $fb->post('/' . $pageId . '/feed', $linkData, $testUserToken); // dd($response->getBody()); // User::query()->where(['']) $testUserToken = 'EAAiLLRwuSRgBAH7I0dQvhXWIjOSejzocB7GkLxKimnkSsCrS43Vs9NNcJvZAEiWt0FUMxwdOAfSxlR0I8IMX9N4X6qZBeoViojSJXCDVUPrY4go7fwkubnwHXDoscGkKzTQXxeWoYv6rIJHmzkkqgg7JlRvfNQgEOu8dmjYQZDZD'; // 发布到pages try { $fb = new Facebook([ 'app_id' => '2404825676269848', 'app_secret' => 'e4387c50b2e0388baa547f60f85aa8f9', 'default_access_token' => $testUserToken, // optional ]); $pageId = '2822252084511458'; $response = $fb->get('/' . $pageId . '?fields=access_token'); dd($response->getBody(), $response->getAccessToken()); } catch (\Throwable $throwable) { } } /** * * @param int $a * @return int */ public function six($a = 1) { error_log(6); return 6; } protected function preparePostFields($array) { if (is_array($array)) { $params = array(); foreach ($array as $key => $value) { $params[] = $key . '=' . urlencode($value); } return implode('&', $params); } else { return $array; } } function diffBetweenTwoDays($day1, $day2) { $second1 = strtotime($day1); $second2 = strtotime($day2); if ($second1 < $second2) { $tmp = $second2; $second2 = $second1; $second1 = $tmp; } return ($second1 - $second2) / 86400; } public function message() { $client = new Client(); $code = ''; $redirect_uri = ''; $client_id = ''; $client_secret = ''; $bearer = 'Bearer '; $authorization = ''; try { $response = $client->request('POST', 'https://platform.hootsuite.com/v1/messages', [ 'headers' => [ 'Authorization' => $authorization ], 'form_params' => [ 'text' => 'authorization_code', 'socialProfileIds' => [ ], 'scheduledSendTime' => date(DATE_ISO8601, strtotime('+8 hour')), 'webhookUrls' => [ ], 'privacy' => [ 'facebook' => [ 'visibility' => [ 'everyone' ] ], 'linkedIn' => [ 'visibility' => [ 'anyone' ] ] ], 'emailNotification' => false, //一个标志,用于确定消息发布时是否发送电子邮件通知。 //对象,用于发送社会配置文件元数据。目前只适用于Pinterest消息 'extendedInfo' => [ [ 'socialProfileType' => 'PINTEREST', 'socialProfileId' => '', 'data' => [ 'boardId' => '', 'destinationUrl' => '' ] ] ] ] ]); dd($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\GuzzleException $exception) { dd($exception->getMessage()); } } public function two123(\Illuminate\Http\Request $request) { dd(""); $client = new Client(); $code = 'qIv0xhL8RZySH_QqcPcvbe8Y17WxnhcjI18rGREbwgg.PGQzVLTwDQsUPL0Aiqbg09ycXtXFNAjPjrhUSPexP4M'; // $redirect_uri = ''; $redirect_uri = 'https://getpostman.com/oauth2/callback'; $client_id = 'c1ada351-6797-406e-8706-342af91ecad5'; $client_secret = 'R-6nps.tHElD'; $bearer = 'Bearer '; $refresh_token = 'pzj7ZzpuhaGhrirTLa9CLkEYXD6tNDesEiPOlIZqiPk.XkqlaBNlxtoiaKHHC9E4JuFx6XZk0pW6_rFkVrBKZ18'; $authorization = base64_encode(sprintf('%s:%s', $client_id, $client_secret)); dd($authorization); try { $response = $client->request('POST', 'https://platform.hootsuite.com/oauth2/token', [ 'headers' => [ 'Authorization' => $authorization ], 'form_params' => [ 'grant_type' => 'refresh_token', // 'code' => $code, // 'redirect_uri' => $redirect_uri, 'scope' => 'offline', 'refresh_token' => $refresh_token ] ]); dd($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\GuzzleException $exception) { dd($exception->getMessage()); } // $client->post(); // $clientId = "5049113417978258277"; // $clientSecret = "c00f71c0587ddb07b506b51c2beafa8ff953f958451d1779c42ada1a02209dfd"; // $redirectUrl = "https://wall.yinqingli.com/demo/two"; // $config = new \SocialiteProviders\Manager\Config($clientId, $clientSecret, $redirectUrl); $user = Socialite::driver('pinterest')->user(); dd($user); $user = Socialite::with('twitter')->user(); dd($user); config([ 'services.pinterest' => [ 'client_id' => env('PINTEREST_CLIENT_ID'), 'client_secret' => env('PINTEREST_CLIENT_SECRET'), 'redirect' => env('PINTEREST_REDIRECT_URL') ] ]); $user = Socialite::driver('facebook')->user(); if (empty($user->token)) { return view('admin/errors/tips', [ 'tips' => '用户令牌获取失败!!!' ]); } try { $pageId = '2822252084511458'; $fb = new Facebook([ 'app_id' => '2404825676269848', 'app_secret' => 'e4387c50b2e0388baa547f60f85aa8f9', 'default_access_token' => $user->token, // optional ]); $response = $fb->get(sprintf('/%s?fields=access_token', $pageId)); $responseJson = json_decode($response->getBody(), true); if (empty($responseJson['access_token'])) { return view('admin/errors/tips', [ 'tips' => '页面令牌获取失败!!!' ]); } $pageToken = $responseJson['access_token']; Social::query()->where(['type' => 'facebook'])->update([ 'token' => $user->token, 'token_expired_at' => date('Y-m-d H:i:s', strtotime('+59 days')), 'page_token' => $pageToken, 'page_token_expired_at' => date('Y-m-d H:i:s', strtotime('+59 days')) ]); return view('admin/errors/tips', [ 'tips' => '授权成功,有效期60天' ]); } catch (\Throwable $throwable) { Log::warning(var_export($throwable->getMessage(), 1)); return view('admin/errors/tips', [ 'tips' => '页面令牌获取失败!!!' ]); } dd($user); // dump($user); return view('admin/errors/tips', [ 'tips' => '授权成功' ]); for ($i = 0; $i < 50; $i++) { auth()->user(); echo '123' . '
'; } return; $user = Socialite::driver('LinkedIn')->user(); Social::query()->where(['type' => 'linkedIn'])->update([ 'token' => $user->token, 'token_expired_at' => date('Y-m-d H:i:s', strtotime('+59 days')) ]); return view('admin/errors/tips', [ 'tips' => '授权成功,有效期60天' ]); dump($request->input()); dd($user); dd($user); $user = Socialite::driver('instagram')->user(); dd($user); $user = Socialite::driver('facebook')->user(); dd($user); $user = Socialite::driver('Twitter')->user(); dd($user); } function bubbleSort($arr) { optional(); $len = count($arr); for ($i = 0; $i < $len - 1; $i++) { for ($j = 0; $j < $len - 1 - $i; $j++) { if (mb_strlen($arr[$j]['source']) < mb_strlen($arr[$j + 1]['source'])) { $tmp = $arr[$j]; $arr[$j] = $arr[$j + 1]; $arr[$j + 1] = $tmp; } } } return $arr; } protected function cancelPass() { $where = [1551, 1602, 1666]; $data = LinkTask::query()->whereIn('id', $where)->get(); // dd($data); LinkTask::query()->whereIn('id', $where)->update(['status' => 3, 'audit_at' => null]); LinkTaskDetail::query()->whereIn('task_id', $where)->update(['status' => 3]); } protected function getEndTime($time, $num = 0) { // return strtotime('+1 month -1 day', $time); return strtotime('last day of -' . $num . ' month', strtotime(date('Y-m-d 23:59:59', $time))); //num=0 return strtotime('first day of -' . $num . ' month', $time); //num=1 } public function getYmOrTime($time, $num = 0, $flag = 0) { $time = strtotime(sprintf('first day of -%s month', $num), $time); return $flag ? $time : date('Ym', $time); } protected function sortSomething($data = [], $condition = []) { $data = [ ['id' => 9], ['id' => 1], ['id' => 2], ['id' => 4], ['id' => 1], ]; $result = []; $condition = [1, 4, 2]; $keyMap = []; foreach ($data as $item) { if (!isset($keyMap[$item['id']])) { $keyMap[$item['id']] = [$item]; } else { $keyMap[$item['id']][] = $item; } } foreach ($condition as $v) { foreach ($keyMap as $key => $item) { if ($v == $key) { foreach ($item as $m) { $result[] = $m; } } } } foreach ($data as $item) { $has = false; foreach ($result as $value) { if ($value['id'] == $item['id']) { $has = true; } } if (!$has) { $result[] = $item; } } return $result; } public function getEndDate($time) { return date('Y-m-d', strtotime('+1 month -1 day', $time)); } private function ex() { throw new \Exception('dasd'); } function insertionSort($arr) { $len = count($arr); for ($i = 1; $i < $len; $i++) { $preIndex = $i - 1; $current = $arr[$i]; while ($preIndex >= 0 && $arr[$preIndex] > $current) { $arr[$preIndex + 1] = $arr[$preIndex]; $preIndex--; } $arr[$preIndex + 1] = $current; } return $arr; } private $_iv = "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"; private $_secret = "2b 73 ae f0 85 7d 77 81 1f 35 2c 07 3b 61 08 d7"; // function strtohex($x) // { // $s = ''; // foreach (str_split($x) as $c) $s .= sprintf("%02X", ord($c)); // return ($s); // } function trimAll($s) { return preg_replace("/\s/", "", $s); } public function pad($data, $blocksize = 16) { $pad = $blocksize - (strlen($data) % $blocksize); return $data . str_repeat(chr($pad), $pad); } function toDec($a) { $aList = explode(" ", $a); foreach ($aList as &$item) { $item = hexdec($item); } return implode("", $aList); } public function cbc($data) { // $iv =openssl_random_pseudo_bytes(16); return openssl_encrypt($data, 'aes-128-cbc', $this->binStr($this->_secret), OPENSSL_ZERO_PADDING, $this->binStr($this->_iv)); } function binStr($hex) { $user = User::query()->firstOrCreate([]); // $aList = explode(" ", $hex); // // foreach ($aList as &$item) { // $item = hex2bin($item); // } // // // return implode("",$aList); return hex2bin($this->trimAll($hex)); } public function maopao($arr) { for ($i = 0; $i < count($arr) - 1; $i++) { for ($j = 0; $j < count($arr) - 1 - $i; $j++) { if ($arr[$j + 1] < $arr[$j]) { [$arr[$j + 1], $arr[$j]] = [$arr[$j], $arr[$j + 1]]; } } } return $arr; } protected function getMonthNum($targetTime) { $target = date('Ym', $targetTime); $now = date('Ym'); $ty = substr($target, 0, 4); $tm = substr($target, 4, 2); $ny = substr($now, 0, 4); $nm = substr($now, 4, 2); $yd = intval($ty) - intval($ny); $md = intval($tm - $nm); $result = $yd * 12 + $md; return $result; } public function mp() { $dataList = [5, 3, 6, 7, 2, 1, 9, 4]; dd($dataList); for ($i = 0; $i < count($dataList) - 1; $i++) { for ($j = 0; $j < count($dataList) - $i - 1; $j++) { if ($dataList[$j] > $dataList[$j + 1]) { [$dataList[$j + 1], $dataList[$j]] = [$dataList[$j], $dataList[$j + 1]]; } } } return $dataList; } public function two() { return view('demo'); } public function one(\Illuminate\Http\Request $request) { $a=(object)['a']; echo "dd","aa"; print "ddd"; print_r($a); var_dump($a); return; // dump("begin"); // dump($request->input()); // dump("end"); $callback = $request->input('callback'); $NVCVal = $request->input('a'); // dump($NVCVal); $iClientProfile = \DefaultProfile::getProfile("cn-hangzhou", "LTAI4GFn9MshqB1EDmDi1pAz", "1Tyw13WirvozGottsxICxDMsLX66lH"); $client = new \DefaultAcsClient($iClientProfile); \DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", "afs", "afs.aliyuncs.com"); $request = new Afs\AnalyzeNvcRequest(); $request->setData($NVCVal);// 必填参数,由前端获取getNVCVal方法获得的值。 // 通过setScoreJsonStr方法声明"服务端调用人机验证服务接口得到的返回结果"与"前端执行操作"间的映射关系,并通知验证码服务端进行二次验证授权。 // 注意:前端页面必须严格按照该映射关系执行相应操作,否则将导致调用异常。 // 例如,在setScoreJsonStr方法中声明"400":"SC",则当服务端返回400时,您的前端必须唤醒刮刮卡验证(SC),如果唤醒滑块验证(NC)则将导致失败。 $request->setScoreJsonStr("{\"200\":\"PASS\",\"400\":\"NC\",\"600\":\"SC\",\"800\":\"BLOCK\"}");// 根据业务需求设置各返回结果对应的客户端处置方式。 $response = $client->getAcsResponse($request); //{"success":true,"result":{"success":false,"msg":"build nvc analyze param error","code":800}} $data = ["success" => true, "result" => [ "code" => $response->BizCode ]]; return sprintf("%s(%s)",$callback, json_encode($data)); // onJSONPCallback() print_r($response); return; setcookie('SameSite', 'Lax'); Log::channel('daily')->info('demo'); return; dd($this->mp()); $a = '555'; dd(substr($a, 6, 5)); $aaa = (object)[ 'a' => 1, 'b' => 2 ]; dd($aaa->c->b ?? ''); $beginAt = date('Y-m-01 00:00:00'); $endAt = date('Y-m-t 23:59:59'); $res = Article::query()->selectRaw('COUNT(id) as total,site_id')->where([['created_at', '>=', $beginAt], ['created_at', '<=', $endAt]]) ->groupBy('site_id')->pluck('total', 'site_id')->toArray(); dd($res); $datetime1 = date_create('2009-10-11'); $datetime2 = date_create('2010-12-13'); $interval = date_diff($datetime1, $datetime2); $records = []; $results = Site::query()->selectRaw('id,domain,cn_title,expired_at,cert_expired_date')->with(['users'])->where(['status' => 3])->get(); foreach ($results as $result) { $records[] = [ 'cn_title' => $result->cn_title, 'domain' => $result->domain, 'expired_at' => $result->expired_at, 'cert_expired_date' => $result->cert_expired_date, 'optimize' => implode(",", $result->users->where('role_id', 26)->where('status', 1)->pluck('nickname')->toArray()) ]; } array_unshift($records, ['项目名称', '域名', '到期时间', 'SSL证书到期时间', '优化师']); return (new BasicExport($records))->download(sprintf('%s.xls', date('YmdHis'))); dd($this->maopao([1, 5, 6, 2, 4, 5])); $records = array( array( 'id' => 2135, 'first_name' => 'John', 'last_name' => 'Doe', ), array( 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith', ), array( 'id' => 5342, 'first_name' => 'Jane', 'last_name' => 'Jones', ), array( 'id' => 5623, 'first_name' => 'Peter', 'last_name' => 'Doe', ) ); dd(array_column($records, null)); // // $pingya = DB::table('user_has_sites')->where(['user_id' => 3])->pluck('site_id')->toArray(); //萍亚 // $lisa = DB::table('user_has_sites')->where(['user_id' => 4])->get(); //lisa // // // foreach ($lisa as $item) { // if (in_array($item->site_id, $pingya)) { // DB::table('user_has_sites')->where(['user_id' => $item->user_id, 'site_id' => $item->site_id])->delete(); // } // } // dd('success'); $client = new Client(); $res = $client->get(' ', [ 'verify' => false, 'timeout' => 50 ]); dd($res->getBody()->getContents()); $aa = array( 'code' => 200, 'data' => array( 'data' => array( 0 => array( 'id' => '6025193629', 'state' => 'SCHEDULED', 'text' => 'Urea as a nitrogen fertilizer is the most important fertilizer in the world\'s agriculture. However, the urea in the soil is rapidly decomposed by the urease enzyme in the soil to decompose a large amo...', 'scheduledSendTime' => '2020-07-07T19:00:00Z', 'socialProfile' => array( 'id' => '128251879', ), 'mediaUrls' => NULL, 'media' => NULL, 'webhookUrls' => NULL, 'tags' => NULL, 'targeting' => NULL, 'privacy' => NULL, 'location' => NULL, 'emailNotification' => false, 'postUrl' => NULL, 'postId' => NULL, 'reviewers' => NULL, 'createdByMember' => array( 'id' => '20746677', ), 'lastUpdatedByMember' => array( 'id' => '20746677', ), 'extendedInfo' => NULL, 'sequenceNumber' => NULL, ), 1 => array( 'id' => '6025193630', 'state' => 'SCHEDULED', 'text' => 'Urea as a nitrogen fertilizer is the most important fertilizer in the world\'s agriculture. However, the urea in the soil is rapidly decomposed by the urease enzyme in the soil to decompose a large amo...', 'scheduledSendTime' => '2020-07-07T19:00:00Z', 'socialProfile' => array( 'id' => '128251866', ), 'mediaUrls' => NULL, 'media' => NULL, 'webhookUrls' => NULL, 'tags' => NULL, 'targeting' => NULL, 'privacy' => NULL, 'location' => NULL, 'emailNotification' => false, 'postUrl' => NULL, 'postId' => NULL, 'reviewers' => NULL, 'createdByMember' => array( 'id' => '20746677', ), 'lastUpdatedByMember' => array( 'id' => '20746677', ), 'extendedInfo' => NULL, 'sequenceNumber' => NULL, ), 2 => array( 'id' => '6025193823', 'state' => 'SCHEDULED', 'text' => 'Urea as a nitrogen fertilizer is the most important fertilizer in the world\'s agriculture. However, the urea in the soil is rapidly decomposed by the urease enzyme in the soil to decompose a large amo...', 'scheduledSendTime' => '2020-07-07T19:00:00Z', 'socialProfile' => array( 'id' => '128251875', ), 'mediaUrls' => NULL, 'media' => NULL, 'webhookUrls' => NULL, 'tags' => NULL, 'targeting' => NULL, 'privacy' => NULL, 'location' => NULL, 'emailNotification' => false, 'postUrl' => NULL, 'postId' => NULL, 'reviewers' => NULL, 'createdByMember' => array( 'id' => '20746677', ), 'lastUpdatedByMember' => array( 'id' => '20746677', ), 'extendedInfo' => NULL, 'sequenceNumber' => NULL, ), ), ), ); dd(json_encode($aa)); dd(date('Y-m-d 00:00:00', strtotime('last day of -1 month'))); $bin = '00001011'; $dec = bindec($bin); dump(chr($dec)); // dump($dec); $hex = bin2hex($bin); dump($hex); // $hello=bin2hex('abcdefgh'); dd(pack("H16", $hex)); // dd($this->trimAll($this->_iv)); // dd($this->toDec($this->_iv)); $a = "15 00 00 00 00 18 86 25 61 29 8B 00 01 02 03 00 00 00 00 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF F4 01 14 0A 0C 5A 08 01 A0 00"; // $a=hexdec($a); // $aList = explode(" ", $a); // // foreach ($aList as &$item) { // $item = hexdec($item); // } // // $a = implode(" ", $aList); // // dump($a); $cdata = $this->cbc($this->binStr($a)); // dump($cdata); dd(bin2hex($cdata)); // $result=$this->pad($cdata); // dd(bin2hex($result)); // dd($this->pad($cdata)); $a = 0x1f; dd($a); $str = "The Supercapacitors: its Basic Principles, Classification, and its Electrical Performance"; $str2 = preg_replace("/[^a-zA-Z0-9\s]/", "", $str); dd(strtolower(preg_replace("/\s+/", "-", $str2))); $words = explode(" ", "The Supercapacitors: its Basic Principles, Classification, and its Electrical Performance"); foreach ($words as &$w) { $w = strtolower($w); } dd(implode("-", $words)); dd(crc32("asdasdasddasdasda")); $hashVal = hash("md5", "dsadasdasdas"); $hashInt = hexdec($hashVal); dd($hashInt); dd(date('Y-m-d', strtotime('2020-01-02'))); $lock = Cache::lock('snap_up:', 10); /** * @var \Illuminate\Cache\RedisLock $lock */ // Role::query()->scopes([])->get(); dd(1 >> 2); dd($lock->release(123)); try { $a = 0; $b = 0; dump($a / $b); } catch (\Throwable $throwable) { throw new \Exception("heng"); } finally { dd(123); } dd($this->insertionSort([5, 1, 3, 4, 6])); $path = 'http://kamcappower.com/uploads/image/20190628/11/application-prospect-of-supercapacitors-in-smart-grid.jpg'; // dd(file_get_contents($path)); $image = \exif_imagetype($path); $mime = image_type_to_mime_type($image); dd($mime); dd(get_class(HootsuiteUser::query()->first())); // $path='https://www.kamcappower.com/uploads/image/20190613/14/medical.jpg'; // $image= exif_imagetype($path); // $mime = image_type_to_mime_type($image); // dd($mime); $path = './demo.jpg'; dd(mime_content_type($path)); dump(filesize($path)); // $data = fopen($path, 'r'); $data = file_get_contents($path); dd(strlen($data)); dump(mime_content_type($data)); dd($data); dd(date('Z')); $sendAt = '2020-06-01 12:12:12'; dd(date(DATE_ISO8601, strtotime($sendAt))); dd(date('Y-m-d\TH:i:s\Z', strtotime($sendAt))); $this->ex(); dd(123); $client_id = 'c1ada351-6797-406e-8706-342af91ecad5'; $redirect_uri = 'https://admin.yinqingli.com/admin/socials/hootsuite'; // $redirect_uri = 'https://getpostman.com/oauth2/callback'; $state = 'helloworld'; return redirect(sprintf( 'https://platform.hootsuite.com/oauth2/auth?response_type=code&client_id=%s&scope=offline&state=%s&redirect_uri=%s', $client_id, $state, $redirect_uri )); dd(3600 + '5'); dd(floor(3599 / 60)); Cache::put('demo', 456, 5); dd(Cache::get('demo')); return; $client = new Client(); $url = sprintf('%s/admin/hootsuite/refresh-token', config('app.wall_url')); try { $response = $client->request('POST', $url, [ 'form_params' => [ 'refreshToken' => 'k4uJi9hyIERYbHPalo494wdSA-wG4h2K4yXNKdTeNzs.Z3Ez16oApdXjZPvFRyAiHrQGMKp3VCY4vI9xJfYI5PY' ] ]); $result = $response->getBody()->getContents(); dd($result); } catch (\GuzzleHttp\Exception\GuzzleException $exception) { dd($exception->getMessage()); } // 阻塞IO 用户线程去读取数据包 内核没有准备好 用户线程阻塞掉 // 非阻塞IO 用户线程轮询去读取数据包 // 多路复用IO 内核线程轮询socket 看看有哪些数据包 准备好 ,如果准备好了 则通知用户线程去读取 // 信号驱动模式 用户线程注册一个信号 ,当内核数据包准备好了的话通知给用户线程 让其以去读取 // 异步IO 用户线程 要去读取数据 内核立马返回好 我知道了 然后当数据包准备好了的话 内核会将数据处理好 并且通知用户线程 已经好了 这里第二阶段是与前四个的主要区别是 当第二阶段内核拷贝数据时 用户线程不会阻塞 dd(date('YW')); $callFn = function () { return ''; }; $a = [5, 8, 1, 5, 3, 2, 6, 9]; dd(max($a)); dd(date('Y-m-t', strtotime('2020-02-01'))); dd($this->getEndDate(strtotime('2020-03-01 00:00:00'))); dd(base64_decode('MjAyMDAz')); DB::connection()->enableQueryLog(); $data = SocialPublish::query()->where(['id' => 4323])->whereJsonContains('result_status->pin', 2)->get(); dump(DB::getQueryLog()); dd($data); // User::query()->select()->where()->exists(); DB::connection()->enableQueryLog(); $result = User::query()->whereIn('id', [])->get(); dd(DB::getQueryLog()); dd($result); dd($this->sortSomething()); $time = $this->getYmOrTime(strtotime('2020-03-01 00:00:00'), 0, 1); dump($time); dd($this->getEndTime($time)); User::query()->whereIn('id', [])->get()->pluck('')->toArray(); $this->cancelPass(); return; $header = [ "typ" => 'jwt', "alg" => 'md5' ]; $payload = [ 'name' => "ggc", 'id' => 1 ]; $signStr = base64_encode(json_encode($header)) . '.' . base64_encode(json_encode($payload)); $sign = md5($signStr); $result = $signStr . '.' . $sign; dd($result); dd(date('w')); $user = User::query()->first(); $time = date('H'); dd($time > 10); $str = '{"displayName":"App\\Jobs\\TranArticle","job":"Illuminate\\Queue\\CallQueuedHandler@call","maxTries":1,"timeout":560,"timeoutAt":null,"data":{"commandName":"App\\Jobs\\TranArticle","command":"O:20:\"App\\Jobs\\TranArticle\":11:{s:7:\"timeout\";i:560;s:5:\"\u0000*\u0000id\";i:9413;s:10:\"\u0000*\u0000content\";s:1376:\"

1H,1H,2H,2H-Perfluorodecyltrimethoxysilane<\/p>

<\/p>

\u672c\u4ea7\u54c1\u5177\u6709\u4f18\u826f\u7684\u62d2\u6c34\u3001\u62d2\u6cb9\u548c\u9632\u53cd\u5c04\u6027\uff0c\u53ef\u7528\u4e8e\u73bb\u7483\u3001\u9676\u74f7\u3001\u82b1\u5c97\u77f3\u3001\u74f7\u7816\u3001\u5929\u7136\u77f3\u6750\u3001\u6728\u5851\u590d\u5408\u6750\u6599\u8868\u9762\u9632\u6c34\u9632\u6c61\u81ea\u6e05\u6d01\u5904\u7406\uff0c\u5efa\u7b51\u6750\u6599\u7684\u6297\u6c61\u6d82\u5c42\uff0c\u6eb6\u80f6-\u51dd\u80f6\u4f53\u7cfb\u7684\u6dfb\u52a0\u5242\uff0c\u6c1f\u7845\u6811\u8102\u7684\u5408\u6210\uff0c\u5316\u5986\u54c1\u4e2d\u989c\u6599\u7684\u8868\u9762\u5305\u8986\uff0c\u5316\u5b66\u6c14\u76f8\u6c89\u79ef\uff08CVD\uff09\u7b49\u3002<\/p>

<\/p>

2-(3,4-Epoxycyclohexyl)ethyltrimethoxysilane<\/p>

<\/p>

\u4e3b\u8981\u5e94\u7528\u4e8e\u6c34\u6027\u6d82\u6599\u7684\u589e\u7c98\u5242\uff0c\u6539\u5584\u6d82\u6599\u7684\u8010\u9ec4\u53d8\uff0c\u9644\u7740\u529b\uff0c\u6d82\u819c\u7684\u8010\u6d17\u5237\u6027;<\/p>

\u4e3b\u8981\u5e94\u7528\u4e8e\u4e19\u70ef\u9178\u548c\u805a\u6c28\u916f\u6c34\u6027\u6d82\u6599\uff0c\u4f5c\u4e3a\u7c98\u63a5\u4fc3\u8fdb\u5242\u548c\u4ea4\u8054\u5242\uff0c\u63d0\u9ad8\u6d82\u5c42\u7684\u8010\u9ec4\u53d8\u3001\u8010\u6c34\u3001\u8010\u78e8\u3001\u8010\u6d17\u5237\u6027\u53ca\u9644\u7740\u529b\u7b49\uff0c\u5ef6\u957f\u5728\u6c34\u6027\u6811\u8102\u4e2d\u7684\u50a8\u5b58\u671f;<\/p>

\u5e94\u7528\u4e8e\u73af\u6c27\u6811\u8102\u548c\u57fa\u6750\u7684\u7c98\u63a5\u5242\uff0c\u6539\u5584\u73af\u6c27\u6811\u8102\u7535\u5b50\u6750\u6599\u3001\u704c\u5c01\u6750\u6599\u3001\u5c24\u5176\u63d0\u9ad8\u6e7f\u6001\u4e0b\u7684\u7535\u6c14\u6027\u80fd\u3002<\/p>

<\/p>

3,3,3-Trifluoropropylmethyldimethoxysilane<\/p>

<\/p>

\u5b83\u7ed3\u5408\u4e86\u6709\u673a\u7845\u4e0e\u6709\u673a\u6c1f\u7684\u4f18\u5f02\u6027\u80fd\uff0c\u5728\u5176\u5206\u5b50\u4e2d\u540c\u65f6\u5177\u6709\u80fd\u4e0e\u65e0\u673a\u8d28\u6750\u6599(\u5982\u73bb\u7483\u3001\u7845\u7802\u3001\u91d1\u5c5e\u7b49)\u5316\u5b66\u7ed3\u5408\u7684\u53cd\u5e94\u57fa\u56e2\u53ca\u4e0e\u6709\u673a\u8d28\u6750\u6599(\u5982\u5408\u6210\u6811\u8102\u3001\u6a61\u80f6\u7b49)\u5316\u5b66\u7ed3\u5408\u7684\u53cd\u5e94\u57fa\u56e2\uff0c\u53ef\u628a\u4e24\u79cd\u6027\u8d28\u60ac\u6b8a\u7684\u6750\u6599\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u8d77\u5230\u6539\u5584\u590d\u5408\u6750\u6599\u7684\u6027\u80fd\u548c\u589e\u52a0\u7c98\u63a5\u5f3a\u5ea6\u7684\u4f5c\u7528\u3002<\/p>

<\/p>\";s:5:\"tries\";i:1;s:6:\"\u0000*\u0000job\";N;s:10:\"connection\";N;s:5:\"queue\";s:9:\"translate\";s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}"}}'; dd(unserialize($str)); // $pendingList = WeekTaskPending::all(); // // foreach ($pendingList as $item) { // WeekTaskInfo::query()->insert([ // 'describe' => $item->describe, // 'duty_id' => $item->duty_id, // 'design_id' => $item->design_id, // 'feedback' => $item->feedback, // 'remark' => $item->remark, // 'status' => $item->status, // 'day' => 0, // 'user_type' => 'wfp' // ]); // } dd('success'); dd(date('W', strtotime('2019-12-29 00:00:00'))); dd(date('Ymd', base64_decode("MTU4Mjk5MTk5OQ=="))); // dd(123); $str = '大家好 我 是vae,下雨,jakfdf daa'; dd(word_count($str)); $token = 'AQV_jYClTugQt6aU8ih9_AH58XsgwQYBXeYFx6_obC9hphCXuUj4ubJ2qr6Bzf8EMiAZSxwLc6saRjCQcsHed3aPwBtZw_XQf1kVBOoGe8aT3rONP3xfw6As-1hmO13B8PBdMLH80Pnk6Ga2eq39kAbOE44poPj5Z8sm_8lcygmutcp07uS4ZaCkqoPnec-7kBZtkVp6LNEC92kA99Br0b5Bx_VmhiYMael3Rb3KQXwSFXW9Asr9bHzc-xOkB_OTJuNMGjd924On0-rKNepwcpeIlmm-QglBdPHUq50ss6bX8B9BxV3tZOsGXFnCwb0z2h4VCXjBsd4UehbtW9zgttuyRtQDng'; try { LinkedinShare::shareNoneCompany($token, 'a test', '45546656', 'accessToken'); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } dd('sdas'); echo 0 % 2; // TranArticle::dispatch(1, '你好ya')->onQueue('translate'); return 123; $reachAt = date_create('2019-02-06 12:00:00'); $nowAt = date_create(); $diff = date_diff($reachAt, $nowAt); dd($diff->d); $hello = User::query()->find(1); dd(optional($hello)->username); dd(date('Y-m-d H:i:s', strtotime('first day of -0 month'))); $dd = [(object)['a' => 1]]; foreach ($dd as $item) { $item->he = "哈哈"; } dd($dd); $var = 'hello'; dd(substr($var, -3, 2)); dd(User::query()->where([])->get()); dd($request->input()); User::query()->get()->when(true, function () { }); dd(Mail::to('15555124010@163.com')->send(new Demo(['msg' => 'hello world']))); $demo = 'a:7:{s:10:"sale_price";i:0;s:12:"price_ladder";a:3:{i:0;a:2:{s:6:"amount";i:3;s:5:"price";d:47;}i:1;a:2:{s:6:"amount";i:4;s:5:"price";d:46;}i:2;a:2:{s:6:"amount";i:5;s:5:"price";d:45;}}s:15:"restrict_amount";s:3:"100";s:7:"deposit";s:2:"10";s:13:"deliver_goods";s:6:"285822";s:15:"retainage_start";i:1524108960;s:13:"retainage_end";i:1524109800;}'; dd(unserialize($demo)); $builder = LinkTask::query()->with(['site', 'worker']); $noticeGroupIds = LinkTask::query()->where(['worker_id' => 8]) ->where([ ['release_at', '<', date('Y-m-d H:i:s', strtotime('+2 day'))], ['release_at', '>', date('Y-m-d H:i:s')], ])->pluck('group_id')->toArray(); $noticeGroupIds = $noticeGroupIds ? $noticeGroupIds : [-1]; $raw = sprintf('(CASE WHEN group_id in (%s) THEN 1 ELSE 0 END) AS flag,link_tasks.*', implode(',', $noticeGroupIds)); dump($raw); $builder->where($condition ?? [])->where(function (\Illuminate\Database\Eloquent\Builder $b) { $b->where('release_at', '<', date('Y-m-d H:i:s'))->orWhereNull('release_at'); }); $tasks = $builder->selectRaw($raw)->orderByDesc('flag')->orderByDesc('id') ->paginate($request->input('pageSize') ?? TABLE_PAGE_SIZE); dd($tasks->items()); dd($this->diffBetweenTwoDays('2019-12-04', '2019-11-01')); dd($request->input("ids"), $request->input("list")); goto hello; $rankConnection = DB::connection('rank'); $maxSn = $rankConnection->table('project_keyword')->where(['project_id' => 103])->max('sn'); dd($maxSn); dd(User::get()); $a = [1, 2, 3]; $index = array_search(1, $a); if ($index !== false) { unset($a[$index]); } dd(array_values($a)); $selects = DB::table('user_has_inquire')->where(['inquire_id' => 1]) ->get()->pluck('user_id')->toArray(); dd($selects); $data = strtotime('2019-10-01 00:00:00'); dd(date('Y-m-d H:i:s', strtotime('+1 month -1 day', $data))); $result = LinkTaskDetail::query()->whereNull('task_id')->where('enable', 1)->update(['status' => 5]); dd($result); dd(User::query()->whereStatus('1')->get()); $client = new Client(); $response = $client->post('http://translate.api.yinqingli.net/translate/translate', [ 'form_params' => [ 'q' => '大家好我是VAE', 'source' => 'en', 'target' => 'zh-CN' ] ]); $str = json_decode($response->getBody()->getContents(), true); $ff = $str['data']['translations'][0]['translatedText']; dd($ff); dd($response->getBody()->getContents()); dd(LinkTaskDetail::query()->selectRaw('link_id,any_value(id) as id')->groupBy('link_id')->limit(2)->get()); dd(explode(',', '')); // // $result=Article::query()->whereNull('publish_at')->whereNotNull('sync_at')->update(['publish_at'=>'']); // // dd($result); dd(SocialPublish::query()->whereJsonContains('result_status', ['pin' => 3])->get()); ILog::query()->create([ 'content' => '12' ]); DB::connection()->enableQueryLog(); $site = Site::query()->withCount('articles')->get(); dd(DB::getQueryLog()); $articleIds = Article::query()->withCount('')->pluck('id')->toArray(); $article = Article::query()->selectRaw('site_id')->whereIn('site_id', $articleIds)->where([ ['created_at', '>', date('Y-m-d H:i:s', strtotime('-2 week'))] ])->groupBy('site_id')->pluck('site_id')->toArray(); dd($article); $xmls = file_get_contents("http://www.peiyangchem.com/sitemap.xml"); $xml = simplexml_load_string($xmls); $xmljson = json_encode($xml); $xml = json_decode($xmljson, true); dd($xml); $homepageReachCount = DB::connection('rank')->table('project_history')->select('top10') ->where([ ['project_id', '=', 570], ['create_time', '<', time()] ])->orderByDesc('create_time')->first(); dd($homepageReachCount); // dd(date('Ym',strtotime('first day of -1 month'))); $rankDatabase = DB::connection('rank'); $result = $rankDatabase->table('webmaster_effect')->selectRaw('SUM(clicks) as clicks,project_id')->whereIn('project_id', [ 252, 291 ])->where(['ym' => date('Ym', strtotime('-1 month'))])->groupBy('project_id')->get()->keyBy('project_id')->toArray(); dd($result); dd(123); dd(Agent::query()->whereRaw('JSON_CONTAINS(JSON_ARRAY("1"),channel_ids)')->get()); app(); $user = User::query()->where(['id' => 1])->first(); dump($user->update(['nickname' => '郭大聪'])); dd($user); // dd(filesize('./demo2.jpg')); // dd(sprintf('%%s%%','hello')); // DB::connection()->enableQueryLog(); // //// $data=Article::query()->where(['site_id' => 50])->where('created_at', '>', 0)->count(); // // User::query()->where('created_at', '>', date('Y-m-d H:i:s'))->get(); // $logs = DB::getQueryLog(); // dd($logs); // // dd(\request()->all()); hello: // $baseUrl = 'https://platform.hootsuite.com'; $online = Site::query()->selectRaw('SUM(id) as count')->where([ ])->groupBy('status')->get()->toArray(); dd($online); optional(); $size = "large"; $var_array = array("color" => "blue", "size" => "medium", "shape" => "sphere"); extract($var_array, EXTR_PREFIX_SAME, "wddx"); echo "$color, $size, $shape, $wddx_size\n"; // $my_array = array("Dog","Cat","Horse"); // // list($a, $b, $c) = $my_array; dd($uu); for ($i = 0; $i < 12; $i++) { dump(date('Y-m-d H:i:s', strtotime('-' . $i . ' month', strtotime(date('Y-m-01 00:00:00', time()))))); } return '123'; $time = strtotime(date('Y-m-01 00:00:00')); $tm = strtotime('last day of -' . 0 . ' month', strtotime(date('Y-m-d 23:59:59', $time))); dd(date('Y-m-d H:i:s', $tm)); dd(date('Y-m-d 23:59:59', time())); dd(date('Y-m-d H:i:s', strtotime('last day of -' . 1 . ' month', strtotime('2019-08-31 23:59:59')))); dd(date('Y-m-d H:i:s', strtotime('+1 month', strtotime('2019-08-31 00:00:00')))); $client = new Client; $response = $client->post('build.cn/api/pin-boards', [ 'form_params' => [ 'token' => 123 ] ]); dd($response->getBody()->getContents()); $str = $response->getBody()->getContents(); dd(bcrypt(123456)); dd(date('Y-m-d 00:00:00', strtotime("first day of next month"))); dd(date('Y-m-01 00:00:00')); dd(date('Y-m-d H:i:s', strtotime('last day of '))); $b = 'dd'; $a = []; dd($a[$b]); // $top10ListMap[$item->old_id]->top10 ?? '未关联'; // dd(Article::query()->where(['site_id'=>50])->where('created_at','>',0)->count()); DB::connection()->enableQueryLog(); Article::query()->where(['site_id' => 50])->where('created_at', '>', 0)->count(); User::query()->where('created_at', '>', date('Y-m-d H:i:s'))->get(); $logs = DB::getQueryLog(); dd($logs); return; // dd(Excel::import(new DemoLinkImport(), '232外链.xlsx', 'public')); // dd(Excel::import(new ArticleImport(), '232文章.xlsx', 'public')); $user = User::query()->first(); $user->makeHidden(['']); // $clientId = "5049113417978258277"; // $clientSecret = "c00f71c0587ddb07b506b51c2beafa8ff953f958451d1779c42ada1a02209dfd"; // $redirectUrl = "https://wall.yinqingli.com/demo/two"; // $config = new \SocialiteProviders\Manager\Config($clientId, $clientSecret, $redirectUrl); return Socialite::driver('pinterest')->scopes(['read_public', 'write_public'])->redirect(); dd('one'); // dd(Site::query()->where(['id'=>122])->update([ // 'webmaster_domain'=>'123' // ])); set_time_limit(0); // // config([ // 'services.twitter.redirect' => sprintf('%s?siteId=%s', config('services.twitter.redirect'), 100) // ]); // // dd(config('services.twitter')); // dd('success'); // // Twitter::reconfig([ // 'consumer_key' => env('TWITTER_CONSUMER_KEY'), // 'consumer_secret' => env('TWITTER_CONSUMER_SECRET'), // 'token' => '1159374080497180673-AkWfJt1gQmqlRPaerDcwTjaFbGnzTz', // 'secret' => 'O1MtL9HhN66nwaDYPmZEZJrwndEppgiEd6wTdL5j2urQL' // ]); // // $content = 'hello world'; // // dd(Twitter::postTweet(['status' => $content])); config([ 'services.twitter.redirect' => sprintf('%s?siteId=%s', config('services.twitter.redirect'), 100) ]); return Socialite::with('twitter')->redirect(); // $user = User::query()->first(); $user = User::find(1); $user->update([ 'nickname' => '郭中聪', ]); dd($user); dd(md5(123456)); $str = 'Military Connectors Will Enter a New Era of "Digital Transmission"'; dd(htmlspecialchars($str)); $users = DB::table('users')->whereIn('id', [5, 1])->get(); foreach ($users as $inx => $user) { dump($inx, $user); } return; $a = 1; dd(compact('a', 'b')); $url = 'http://www.yinqingli.com'; $content = 'hello world'; $token = 'AQVN7nSiMlOjcK4meXnQWcAuXE3yxonYFHrhNnANF5BXBnuSM8X_eccBZKJDjbKzaq1qcaye3IPZSinqcmBKzF4bJwJWTyXYTmUM_-RjEfH-bEzrorVTu1A_kWY83M06pRyMhLrCmcm61UZg5TNsIzlEvap_4H65V-A7WsRNv4Xn5OPvMOb4gXze4opr-vIMVrJaVsYpyp1CBj0lQY6W8PQs208WAzL_ietV7AozWnp04gMIcQhYTotsm_ZvuzskG5cAhVY23P8uZiIFLZnOg6gKVfi_HnqvPCJ-Du8thmnoUjQ_ONSbgdV3LlFDdTJ2flpwZjNesKTfcEVZKG_Q-gbURms1Kw'; dd(LinkedinShare::shareArticleCompany($token, $url, $content, 'accessToken')); return true; dd(User::query()->whereIn('id', [5, 1])->get()); // dd(); dd(trim(null)); dd(User::query()->with('trashed')->get()); // $a = mt_rand(0, 1); // // echo date('Y-m-d H:i:s').'
'; // if ($a) { // sleep(10); // echo date('Y-m-d H:i:s'); // echo 'true'; // } else { // echo date('Y-m-d H:i:s'); // echo 'false'; // } // dd('done'); $lock = Cache::lock('foo', 10); $result = $lock->get(); // dump($result); if ($result) { sleep(8); echo $result ? '1' : '2'; echo date('Y-m-d H:i:s'); return '操作中...'; } else { echo date('Y-m-d H:i:s'); return '没得锁...'; } // $lock=Cache::lock('foo', 10); // // if ($lock->block(5)) { // // 等待最多5秒后获取锁定... // return '有锁'; // } // dd('done'); $lock = Cache::lock('foo', 10); $result = $lock->get(); // dump($result); if ($result) { //获取锁定10秒... sleep(9); return '操作中...'; // $lock->release(); } else { return '没得锁...'; } // dd('done'); // Cache::put('foo','demo',10); // dd(Cache::get('foo')); // Cache::lock('foo',10); // dd(Cache::get('foo')); // if (Cache::lock('foo', 10)->get()) { // // 获取锁定10秒... // echo 1; // Cache::lock('foo')->release(); // // } else { // echo 2; // } // if (Cache::lock('foo', 10)->block(5)) { // // 等待最多5秒后获取锁定... // // echo '1'; // } else { // echo 2; // } // // Cache::store('redis')->put('hello_1','world',10); // return; dd(Cache::store('redis')->get('hello_1')); dd(Redis::get('123')); dd(111); $_publisher = 1; echo $_publisher; dd(mt_rand(100, 999)); return Socialite::with('facebook')->scopes(['manage_pages', 'publish_pages'])->redirect(); // $demo = UrlCheck::query()->where([['created_at', '>', date('Y-m-d H:i:s')]])->get(); // dd($demo); $one = 1; $two = 2; // dd(1); dd(compact('one', 'two', 'three')); $linkTypes = Link::TYPES + ['已过期']; dd($linkTypes, array_values($linkTypes)); dd(new \DateTime(date('Y-m-t 23:59:59'))); Cache::put(sprintf('index_%s', date('Ym')), serialize([1, 2]), new \DateTime(date('Y-m-t 23:59:59'))); dd(date('Y-m-d H:i:s', strtotime(date('Y-m-t 23:59:59')))); dd(date('Y-m-t', strtotime('2019-07'))); dd(date('Y-m-t 23:59:59')); $nowDatetime = new \DateTime(); $reachDatetime = new \DateTime('2019-07-19 19:00:00'); dump($interval = $nowDatetime->diff($reachDatetime)); dd($interval->format('%a')); dd(date('Y-m-d H:i:s', strtotime('next month', strtotime('2019-12')))); return; $users = User::query()->select()->where()->distinct()->get(); $rankDatabase = DB::connection('rank'); $data = $rankDatabase->table('project_keyword')->selectRaw(' SUM(CASE WHEN google_rank <= 10 THEN 1 ELSE 0 END) as top10, SUM(CASE WHEN google_rank <= 30 THEN 1 ELSE 0 END) as top30, SUM(CASE WHEN google_rank <= 100 THEN 1 ELSE 0 END) as top100 ')->where([])->whereIn('project_id', [103, 91])->groupBy('project_id')->get(); dd($data); dd(array_column(Site::NATURE_TYPE, 'val', 'inx')); $sites = Article::query()->whereExists(function (Builder $builder) { $builder->select(DB::raw(1))->from('user_has_sites')->whereRaw('user_id=1 AND user_has_sites.site_id=sites.id '); })->get(); dd($sites); $userRecords = User::query()->with('sites')->whereIn('id', [10])->get(); foreach ($userRecords as $record) { $record->sites()->attach(2); dd($record->sites->pluck('id')->toArray()); } return; return Socialite::with('facebook')->redirect(); dd(Site::query()->whereNotExists(function (Builder $builder) { $builder->select(DB::raw(1))->from('sites_process') ->whereRaw('sites_process.process_id=15 AND sites_process.active=1 AND sites.id = sites_process.site_id');; })->get()); DB::connection('rank')->table('traffic_report_hourly')->selectRaw('SUM(pv) AS pv')->where([ ['create_time', '>', strtotime(date('Y-m-01'))], ['create_time', '<', strtotime(date('Y-m-t'))] ])->groupBy('project_id')->get(); dd(Site::query()->selectRaw('COUNT(id) as total,nature_type')->groupBy('nature_type')->get()); $result = DB::connection('rank')->table('project_history')->selectRaw('Max(create_time) as max,top10,project_id')->where([ ['create_time', '>', strtotime(date('Y-m-01'))], ['create_time', '<', strtotime(date('Y-m-t'))] ])->groupBy('project_id')->get(); dd($result); $config = [ 'connection_name' => sprintf('connection_name_%s', 20), 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'demo', 'username' => 'root', 'password' => '123', ]; config_connection($config); try { $record = DB::connection($config['connection_name'])->table('content')->where(['id' => 5])->first(); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } dd(123); return Socialite::with('LinkedIn')->scopes(['r_emailaddress', 'r_liteprofile', 'w_member_social'])->redirect(); $file = 'http://admin.yinqingli.com/storage/201907/jpg/1rZSMSmdfN3XUJSSSZc9ThmYFXZxSiAl2EYROFoJ.jpg'; dd(pathinfo($file)); $data = file_get_contents($file); // dd($data); // dd(Storage::putFile('photos',$data)); dd(Storage::disk('public')->put('file2.jpg', $data, 'public')); dd($data); $a = 1; dd(compact('a')); dd(Site::query()->select(['old_id'])->whereIn('id', [])->pluck('old_id')->filter()); $collection = collect([ ['a' => 1], ['a' => 2], ['a' => 3], ['a' => 4], ]); dd($chunks = $collection->chunk(3)->toArray()); $url = 'https://serpbook.com/serp/api/?action=addkeyword&auth=2fd8ddefa9f2874f54afde3223b364cc&url=jhhearing.com&kw=jinghao%20hearing®ion=google.com&language=en&category=yql'; $http = new Client; try { $response = $http->request('get', $url); } catch (\GuzzleHttp\Exception\GuzzleException $throwable) { dd(); } dd($response->getBody()->getContents()); $a = 1; dd((array)$a); $uploaded_media = \Thujohn\Twitter\Facades\Twitter::uploadMedia(['media' => File::get(public_path('demo-head.png'))]); \Thujohn\Twitter\Facades\Twitter::postTweet(['status' => 'Laravel is beautiful', 'media_ids' => $uploaded_media->media_id_string]); dd('success'); return; $temp = SiteProcess::query()->find(584); $evaluate = $temp->evaluate ?? []; dd(array_merge($evaluate, ['score_feedback' => ['score' => 5]])); dd($evaluate); dd(User::query()->where(['id' => 1])->update(['nickname' => '郭中聪'])); $a = null; dd($a->ll ?? null); dd(substr('123', 1)); $cont = '

profile_small.jpglogo_new.png

'; $url = str_replace('/', '\/', config('app.url')); dd(preg_replace(sprintf('/%s/i', $url), '', $cont)); dd(app('ueditor.storage')); dd(Site::query()->first(['old_id'])); dd($this->ins()); return Socialite::with('instagram')->redirect(); $url = str_replace('/', '\/', 'http://test.yinqingli.com'); // dd($url); dd(preg_replace_callback(sprintf('/(src=.)%s/i', $url), function ($matches) { dump($matches[1]); return $matches[1]; }, '')); // return Socialite::with('facebook')->scopes(['manage_pages', 'publish_pages'])->redirect(); // return Socialite::with('Twitter')->redirect(); // return Socialite::with('Instagram')->redirect(); return Socialite::with('LinkedIn')->scopes(['r_emailaddress', 'r_liteprofile', 'w_member_social'])->redirect(); config(['database.connections.' . $dbConfig->connection_name => [ 'driver' => 'mysql', 'host' => $dbConfig->host, 'port' => $dbConfig->port, 'database' => $dbConfig->database, 'username' => $dbConfig->username, 'password' => $dbConfig->password ]]); DB::connection($dbConfig->connection_name)->table(''); $taskDetailRecords = LinkTaskDetail::query()->whereIn('task_id', [1, 3])->get(); //获取与人物关联的任务详情记录 dump($taskDetailRecords->pluck('task_id', 'id')->toArray()); dd(123); // Collection:: dd(LinkTaskUrl::query()->whereIn('link_tasks_detail_id', [1])->get()->groupBy('link_tasks_detail_id')); $data = LinkTask::query()->first(); dd($data->links); dd($data->links()->sync([2])); foreach ($data->links as $link) { dump($link->pivot); } return; $record = Article::query()->filter($filter)->get()->toArray(); dd($record); // $client = new Client; // $promiseList[] = $client->requestAsync('GET', 'http://build.cn/demo/two'); // $promiseList[] = $client->requestAsync('GET', 'http://build.cn/demo/three'); //// $promiseList[] = $client->requestAsync('GET', 'http://build.cn/demo/four'); //// $promiseList[] = $client->requestAsync('GET', 'http://build.cn/demo/five'); //// $promiseList[] = $client->requestAsync('GET', 'http://build.cn/demo/six'); // try { // $resultList = unwrap($promiseList); // } catch (\Throwable $throwable) { // dd($throwable->getMessage()); // return; // } // // foreach ($resultList as $item) { // dump($item->getBody()->getContents()); // } // return 123; $urlList = ['two', 'three', 'four', 'five', 'll']; $client = new Client([ 'timeout' => 5 ]); $requests = function () use ($urlList) { // error_log('total=' . $total); foreach ($urlList as $item) { yield new Request('GET', sprintf('http://build.cn/demo/%s', $item)); } }; $pool = new Pool($client, $requests(), [ 'concurrency' => 5, 'fulfilled' => function (Response $response, $index) { error_log('success'); error_log(var_export($index, 1)); // dump($response->get); }, 'rejected' => function (ClientException $exception, $index) { error_log('fail'); error_log(var_export($exception->getMessage(), 1)); }, ]); $promise = $pool->promise(); $promise->wait(); return 'success'; // $this->secret_key = isset($key) ? $key : exit('key为必须项'); // // $this->method = $method; // // $this->iv = $iv; // // $this->options = $options; $encData = openssl_encrypt('44', 'aes-128-ecb', '456'); dd($encData); dd(openssl_encrypt('1112', OPENSSL_CIPHER_AES_128_CBC, '456')); dd(call_user_func_array(array($this, 'demo'), ['a' => 1])); error_log('123'); return; $t = SiteProcess::find(12); dd($t->detail); dd(TABLE_PAGE_SIZE); dd(Route::currentRouteName()); // $config = [ // // HTTP 请求的超时时间(秒) // 'timeout' => 5.0, // // // 默认发送配置 // 'default' => [ // // 网关调用策略,默认:顺序调用 // 'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class, // // // 默认可用的发送网关 // 'gateways' => [ // 'aliyun', // ], // ], // // 可用的网关配置 // 'gateways' => [ // 'errorlog' => [ // 'file' => '/tmp/easy-sms.log', // ], // 'aliyun' => [ // 'access_key_id' => 'LTAINvaCNbO0kN9A', // 'access_key_secret' => 'stvr2EocXDDKW3MZN7csi0SIuuVb6G', // 'sign_name' => '引擎力', // ], // //... // ], // ]; // // $easySms = new EasySms($config); // // dd($easySms->send(15555124010, [ // 'content' => '您的验证码为: 6379', // 'template' => 'SMS_162110318', // 'data' => [ // 'code' => 6379 // ], // ])); $sms = new EasySms(); try { dd($sms->send(15555124010)); } catch (\Throwable $throwable) { dd($throwable->getMessage()); } dd(json_decode((new Translate)->request('短短十年左右,中国不仅跃升为混凝土设备年销量、保有量世界第一的国家,更诞生了全球领军的混凝土设备制造商。目前徐工、中联、三一三家企业占据了全球混凝土设备市场90%以上的份额。在中国混凝土设备市场最红火的2012年,全年各类混凝土设备销量超过7万台,销售收入约为1000亿元人民币。2013年,在混凝土泵车销量大幅下滑的情况下,混凝土搅拌站销量依然与2012年持'), true)); dd(Uuid::uuid1()); $api = 'TFXmzOx3EwYhJoS1p1Fma2A4JkqPXjYO'; $client = new Client; $response = $client->post('http://openapi.youdao.com/api', [ 'q' => '你好,世界', 'from' => 'auto', 'to' => 'auto', 'appKey' => $api, 'signType' => 'v3', 'curtime' => time(), 'salt' => Uuid::uuid1(), 'sign' => '' ]); $str = $response->getBody()->getContents(); dd($str); $client = new Client; $response = $client->request('get', 'http://www.bts-biotechnology.com/openapi/content/getOptsByJson'); $str = $response->getBody()->getContents(); dd($str); dd(asset('storage/201904/jpg/tVIr4ywlWQ3FvrpJwlbSfkHz0dYUUJXPbVgw5J1U.jpeg')); dd(base64_decode('MTU1NDk5ODQwMA==')); dd(strtotime(date('Ym00')) + 86400 * 2); dd(); return view('system/user_show'); DB::connection()->enableQueryLog(); Project::query()->scopes(['project' => ['projectIds' => [1]]])->get(); dd(DB::getQueryLog()); dd(strtotime(date('Ymd 00:00:00'))); dd(strtotime('-1 month', strtotime('-1 day'))); Permission::query()->updateOrCreate([ 'type' => rand(1, 100) ], ['id' => 12]); return 123; $content = '{{$name}}{{$email}}'; $view = view($content, ['name' => 'laravel', 'email' => 'laravel@laravel-china.org']); $contents = $view->render(); dd($view); dd(date('Y-m-d H:i:s', strtotime('20180231'))); dd(strtotime(date('Ymd000000'))); dd(date('Y年m月d H:i:s', strtotime('-1 day', strtotime(date('Ymd00:00:00'))))); } public function tableList() { $users = Permission::query()->paginate(); dump($users->items()); return response()->json([ 'rows' => $users->items(), 'total' => $users->total() ]); } function blade2str($blade, $data = array()) { } }