makeMemberMiniQrCode(['member_id' => $member_id]); $url = $this->mini_code($member_id); } public function testMakeChannel() { $channels = [1000,1001]; //第一次1000块钱的线上推广 $leaflets = [2000,2001]; //传单 $group = [3000,3001,3002]; //传单 $ald = [4000,4001,4002]; //传单 $this->makeChannelCode($group); } private function makeChannelCode($channels) { foreach ($channels as $channel) { $resp = thrid_author\signaturer::instance()->minicode("/pages/index/index?channel={$channel}",430); if(!empty($resp)) { $save_path = BASE_ROOT_PATH . "/test/channel/{$channel}.png"; $length = file_put_contents($save_path,$resp); if(!$length) { Log::record("Cannot write file: {$save_path}",Log::ERR); } else { Log::record("Create channel image success.",Log::DEBUG); $share_path = BASE_ROOT_PATH . "/test/channel/share-{$channel}.png"; $this->create_shareimage($save_path,$share_path); } } } return false; } private function create_shareimage($mini_path,$share_path) { $back_img = BASE_RESOURCE_PATH . '/mobile/member/images/share.jpg'; $back = $this->create_image($back_img); $mini = $this->create_image($mini_path); $dest = imagecreatetruecolor(imagesx($back), imagesy($back)); imagecopy($dest,$back, 0, 0, 0,0, imagesx($back), imagesy($back)); imagecopyresized($dest,$mini, 30, 750, 0,0, 168,168,imagesx($mini), imagesy($mini)); imagepng($dest, $share_path); } private function create_image($file) { $imagetype = exif_imagetype($file); if ($imagetype === false) { return false; } switch ($imagetype) { case IMAGETYPE_GIF: $image = @imagecreatefromgif($file); break; case IMAGETYPE_JPEG: case IMAGETYPE_JPEG2000: $image = @imagecreatefromjpeg($file); break; case IMAGETYPE_PNG: $image = @imagecreatefrompng($file); break; case IMAGETYPE_BMP: $image = @imagecreatefrombmp($file); break; default: return false; } return $image; } public function testSendInviter() { $inviter_id = 52641; $invitee_id = 52638; $queue_logic = Logic('queue'); $queue_logic->sendInviterSubMsg(['inviter_id' => $inviter_id,'invitee_id' => $invitee_id]); $openid = 'ocimY5Bi5voa71ejczOUmxqsDgtU'; $tmpid = 'zBNktaey9EM2DcBzUNsjnAan2NvYpj_nKZDY__f9pGA'; $time = '2020年8月7日'; $data = ['thing4' => ['value' => '江南'], 'time3' => ['value' => "{$time}"]]; thrid_author\signaturer::instance()->send_submsg($openid,$tmpid,'pages/index/index',$data); } private function mini_code($uid) { $passwd = util::passwd; $name = md5("{$uid}.{$passwd}") . ".png"; $save_path = BASE_UPLOAD_PATH . DS . ATTACH_MINI_QRCODE . DS . $name; $url = UPLOAD_SITE_URL . DS . ATTACH_MINI_QRCODE . DS . $name; if(!file_exists($save_path)) { QueueClient::push('makeMemberMiniQrCode',['member_id' => $uid]); } return $url; } public function testPgenA() { for ($i = 0; $i < 1000;$i++) { $save_path = BASE_UPLOAD_PATH . DS.ATTACH_MQRCODE.DS . "{$i}.png"; util::qrcode("http://www.baidu.com","{$i}.png"); } } public function testPgenB() { for ($i = 1000; $i < 2000;$i++) { $save_path = BASE_UPLOAD_PATH . DS.ATTACH_MQRCODE.DS . "{$i}.png"; util::qrcode("http://www.baidu.com","{$i}.png"); } } public function testPgenC() { $bonus_urls = 'http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=37011497008878285022,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=49871497008878288715,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=33191497008878290461,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=82431497008878291960,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=75231497008878293546,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=44051497008878295127,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=53821497008878296732,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=86091497008878298565,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=74421497008878300374,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=14151497008878302183,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=32051497008878303995,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=20181497008878305885,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=21191497008878307698,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=98471497008878309606,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=65191497008878310999,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=74271497008878312456,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=73931497008878314075,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=34831497008878315481,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=89881497008878316845,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=22671497008878318517,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=83171497008878320622,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=64211497008878322835,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=46141497008878324900,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=66361497008878326428,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=70031497008878328081,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=63311497008878329563,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=48021497008878331028,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=57461497008878332611,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=53811497008878334176,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=35381497008878335685,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=60581497008878337530,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=40351497008878339039,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=34101497008878340555,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=45241497008878342056,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=99571497008878343781,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=98201497008878345332,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=11161497008878346835,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=50641497008878348356,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=31871497008878349868,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=10441497008878351341,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=86001497008878353114,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=84661497008878354491,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=66581497008878355813,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=51331497008878357564,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=50671497008878359373,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=24191497008878361338,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=47561497008878363350,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=93111497008878365557,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=35871497008878367456,http://p.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=39991497008878369137'; $urls = explode(',',$bonus_urls); $i = 0; foreach ($urls as $url) { $save_path = "/Users/stanley-king/Desktop/qrcode/{$i}.png"; util::qrcode_path($url,$save_path); $i++; } } public function testPgenD() { $roomid = 37; $inviter = 39623; require_once(BASE_ROOT_PATH . '/helper/url_helper.php'); // $url = url_helper::room_invite_url($roomid,$inviter); $url = "http://192.168.0.131/mobile/index.php?act=member_talk&op=qr_invite&client_type=ajax&room_id=37&inviter=39623&relay_id=0"; $save_path = "/Users/huangdong/work/shopnc/data/upload/room/qrcodes/{$roomid}_{$inviter}.png"; if(!file_exists($save_path)){ util::qrcode_path($url,$save_path); } // unlink($save_path); } }