1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140 |
- <?php
- namespace App\Http\Controllers;
- use App\Exports\BasicExport;
- use App\Http\Filters\DemoFilter;
- use App\Http\Logics\Admin\SiteSyncLogic;
- use App\Http\Models\Agent;
- use App\Http\Models\Article;
- use App\Http\Models\HootsuiteUser;
- use App\Http\Models\ILog;
- use App\Http\Models\Link;
- use App\Http\Models\LinkTask;
- use App\Http\Models\LinkTaskDetail;
- use App\Http\Models\LinkTaskUrl;
- use App\Http\Models\MasterMeter;
- use App\Http\Models\Permission;
- use App\Http\Models\Project;
- use App\Http\Models\Role;
- use App\Http\Models\Site;
- use App\Http\Models\SiteProcess;
- use App\Http\Models\Social;
- use App\Http\Models\SocialPublish;
- use App\Http\Models\UrlCheck;
- use App\Http\Models\User;
- use App\Http\Models\WeekTaskInfo;
- use App\Imports\ArticleImport;
- use App\Imports\DemoImport;
- use App\Imports\DemoLinkImport;
- use App\Imports\DemoLinkTypeImport;
- use App\Jobs\TranArticle;
- use App\Libs\EasySms;
- use App\Libs\Translate;
- use App\Mail\Demo;
- use DirkGroenen\Pinterest\Pinterest;
- use Facebook\Facebook;
- use function foo\func;
- use GuzzleHttp\Client;
- use GuzzleHttp\Exception\ClientException;
- use GuzzleHttp\Exception\RequestException;
- use GuzzleHttp\Pool;
- use function GuzzleHttp\Promise\unwrap;
- use GuzzleHttp\Psr7\Request;
- use GuzzleHttp\Psr7\Response;
- use Illuminate\Contracts\View\Factory as ViewFactory;
- use Illuminate\Database\Eloquent\Collection;
- use Illuminate\Database\Query\Builder;
- use Illuminate\Support\Facades\Blade;
- use Illuminate\Support\Facades\Cache;
- use Illuminate\Support\Facades\Crypt;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\File;
- use Illuminate\Support\Facades\Log;
- use Illuminate\Support\Facades\Mail;
- use Illuminate\Support\Facades\Redis;
- use Illuminate\Support\Facades\Route;
- use Illuminate\Support\Facades\Storage;
- use Illuminate\Support\Facades\View;
- use Illuminate\Support\Str;
- use Laravel\Socialite\Facades\Socialite;
- use Lightit\LinkedinShare\Facades\LinkedinShare;
- use Maatwebsite\Excel\Facades\Excel;
- use function PHPSTORM_META\type;
- use Psr\Http\Message\ResponseInterface;
- use Ramsey\Uuid\Uuid;
- use Thujohn\Twitter\Facades\Twitter;
- use afs\Request\V20180112 as Afs;
- //use Overtrue\EasySms\EasySms;
- class DemoController extends Controller
- {
- public function demo()
- {
- $a=xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY,[]);
- // Collection::
- return 123;
- }
- protected $method;
- /**site
- * var string $secret_key 加解密的密钥
- */
- protected $secret_key;
- /**
- * var string $iv 加解密的向量,有些方法需要设置比如CBC
- */
- protected $iv;
- /**
- * @R
- * var string $options (不知道怎么解释,目前设置为0没什么问题)
- */
- protected $options;
- public function encrypt($data)
- {
- return openssl_encrypt($data, $this->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' . '<br>';
- }
- 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:\"<p>1H,1H,2H,2H-Perfluorodecyltrimethoxysilane<\/p><p><br\/><\/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><br\/><\/p><p>2-(3,4-Epoxycyclohexyl)ethyltrimethoxysilane<\/p><p><br\/><\/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><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><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><br\/><\/p><p>3,3,3-Trifluoropropylmethyldimethoxysilane<\/p><p><br\/><\/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><br\/><\/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').'<br>';
- // 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 = '<p><img src="http://build.cn/storage/uploads/image/2019/07/01/b514629e083d49294270198aa58338f6.jpg" title="/uploads/image/2019/07/01/b514629e083d49294270198aa58338f6.jpg" alt="profile_small.jpg"/><img src="http://build.cn/storage/123" title="123" alt="logo_new.png"/></p>';
- $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];
- }, '<img src="http://test.yinqingli.com/storage/201906/jpg/mAT971ksTiUKs0JtM59K7CGPdqE75SlfDul0IFf4.jpeg">'));
- // 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())
- {
- }
- }
|