#343

    作者:广西河池市
    文章:电脑常用软件收藏推荐收集【持续更新】  发表时间:2019-11-02, 01:24:17  
    展开↯

    #344

    作者:广西南宁市
    laravel wherein order by 排序
    ->whereIn('os.id',$oi_id) ->orderByRaw("FIELD(pre_os.id, " . implode(", ", $oi_id) . ")")
    Run code
    Cut to clipboard
      文章:laravel wokerman启动没有显示监听端口  发表时间:2019-10-30, 11:49:03  
      展开↯

      #345

      作者:广西南宁市
      唐僧每次出场都这样介绍自己:1.贫僧唐三藏;2.从东土大唐而来;3.去往西天拜佛取经。 短短一个开场白道破了这个困扰着古今中外的世间三问
      文章:@意见反馈/技术支持/伊网/安企网  发表时间:2019-10-30, 11:31:01  
      展开↯

      #346

      作者:广西南宁市
      VSCode代码自动换行设置
      File>>Preferences>>settings>>UserSettings>>CommonlyUsed>>找到Editor:WordWrap,将off修改为on即可
      Run code
      Cut to clipboard
        文章:程序员编程常用网页工具集[游戏]  发表时间:2019-10-28, 09:47:08  
        展开↯

        #347

        作者:广西玉林市
        十分钟一次就是:
        crontab -e
        Run code
        Cut to clipboard

          */10 * * * * /usr/bin/curl https://xx.com/v2/other/strun
          Run code
          Cut to clipboard
            文章:服务器定时执行计划任务  发表时间:2019-10-24, 01:45:37  
            展开↯

            #348

            作者:广西南宁市
            js判断json对象是否为空
            JSON.stringify(a)!="{}" && JSON.stringify(a)!="[]" && a && a!='null'
            Run code
            Cut to clipboard
              文章:微信小程序开发笔记  发表时间:2019-10-23, 14:48:53  
              展开↯

              #349

              作者:广西南宁市
              文章:@意见反馈/技术支持/伊网/安企网  发表时间:2019-10-15, 16:58:16  
              展开↯

              #350

              作者:广西河池市
              二维码 QR Code 翻译
              #,广西南宁市,2019-09-27,18:14:32,
              $url='http://www.baidu.com'; $img = \QrCode::format('png')->size(200)->generate($url); //format 是指定生成文件格式 默认格式是svg,可以直接在浏览器打开,png不能直接显示 return $data = 'data:image/png;base64,' . base64_encode($img ); //转成base64,放在img的src里就可以显示
              Run code
              Cut to clipboard
                文章:使用PHP生成二维码的两种方法(带logo图像)  发表时间:2018-09-13, 12:13:17  
                展开↯

                #351

                作者:广西南宁市
                <?php $url = 'http://localhost/3.php'; $opt_data = 'name=BY2&age=999&sex=MAXMAN'; $curl = curl_init(); //初始化 curl_setopt($curl,CURLOPT_URL,$url); //设置url curl_setopt($curl,CURLOPT_HTTPAUTH,CURLAUTH_BASIC); //设置http验证方法 curl_setopt($curl,CURLOPT_HEADER,0); //设置头信息 curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); //设置curl_exec获取的信息的返回方式 curl_setopt($curl,CURLOPT_POST,1); //设置发送方式为post请求 curl_setopt($curl,CURLOPT_POSTFIELDS,$opt_data); //设置post的数据 $result = curl_exec($curl); if($result === false){ echo curl_errno($curl); exit(); } print_r($result); curl_close($curl); ?>
                Run code
                Cut to clipboard
                  #,广西南宁市,2019-09-23,18:08:57,
                  PHP删除n天以前的文件,删除指定目录下指定类型(扩展名)的文件,包括子目录子和目录下的文件. 其中$ext数组代表不删除的文件扩展名. 调用函数trash('目录名',时间值);如trash('./files',3600) 参数时间值的单位是秒,如果省略不写,使用trash('./'),将删除当前时间10秒前及更早的文件. <?php function trash($folder,$time=10){ $ext=array('php','htm','html'); //带有这些扩展名的文件不会被删除. $o=opendir($folder); while($file=readdir($o)){ if($file !='.' && $file !='..' && !in_array(substr($file,strrpos($file,'.')+1),$ext)){ $fullPath=$folder.'/'.$file; if(is_dir($fullPath)){ trash($fullPath); @rmdir($fullPath); } else { if(time()-filemtime($fullPath) > $time){ unlink($fullPath); } } } } closedir($o); } trash('./');//调用自定义函数 ?>
                  Run code
                  Cut to clipboard
                    文章:PHP下使用CURL方式POST数据至API接口的代码  发表时间:2019-09-18, 17:56:10  
                    展开↯

                    #352

                    作者:广西河池市
                    //echo 'dfasfads'; //dump(count($mendian_info)); if(!count($mendian_info)){ $mendian_info=[]; $mendian_info['0']['mendian_info_num']=0; $mendian_info['0']['sttt']=$sttt; //$mendian_info->{0}=''; //$mendian_info->{0}->mendian_info_num=0;//$mendian_info_num; //$mendian_info->{0}->sttt=$sttt; }//Base::exitError('fail'); else{ //$mendian_info['0']->mendian_info_num=count($mendian_info);//$mendian_info_num; //$mendian_info['0']->sttt=$sttt; } //dump($mendian_info); Base::exitSuccess('success',$mendian_info);
                    Run code
                    Cut to clipboard
                      #,广西河池市,2019-09-22,03:14:03, php中访问对象中名字叫0的成员
                      在别的地方看到了答案,贴到这里让更多同学们学习一下吧 $a = new \stdClass(); $a->{0} = "test"; var_dump($a); //object(stdClass)#1 (1) { ["0"]=> string(4) "test" } echo $a->{0}; //test
                      Run code
                      Cut to clipboard
                        #,广西河池市,2019-09-22,03:14:19,
                        obj[0]['字段名字']
                        Run code
                        Cut to clipboard
                          #,广西河池市,2019-09-22,03:15:15, laravel框架的whereIn条件或者where条件里面的in条件
                          $where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];
                          Run code
                          Cut to clipboard

                            $where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];
                            Run code
                            Cut to clipboard
                              #,广西河池市,2019-09-22,03:15:32,
                              //in查询应该用whereIn $condition[] =['check_doctor_uid','in',$check_doctor_id]; // 错误 // Illuminate\Database\Query\Builder关于operators定义中,并没有in public $operators = [ '=', '<', '>', '<=', '>=', '<>', '!=', 'like', 'like binary', 'not like', 'between', 'ilike', '&', '|', '^', '<<', '>>', 'rlike', 'regexp', 'not regexp', '~', '~*', '!~', '!~*', 'similar to', 'not similar to', 'not ilike', '~~*', '!~~*', ]; //->where($condition) 这种写法有问题
                              Run code
                              Cut to clipboard
                                #,广西河池市,2019-09-22,03:15:44, 可以用when方法去写
                                文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-09-22, 03:12:46  
                                展开↯

                                #353

                                作者:广西南宁市
                                Workerman kill
                                killall -9 php php artisan workman start --d
                                Run code
                                Cut to clipboard

                                  killall -9 php ps aux|grep WorkerMan|awk '{print $2}'|xargs kill -9
                                  Run code
                                  Cut to clipboard
                                    #,广西南宁市,2019-09-04,11:42:10, 调试模式
                                    php artisan workman start
                                    Run code
                                    Cut to clipboard
                                      文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-09-03, 18:23:45  
                                      展开↯

                                      #354

                                      作者:广西南宁市
                                      nginx 反向代理 wss转ws 服务端不变
                                      #服务器socket连接端口9999,为了避免冲突,这里用9990反向代理到9999,同时实现了wss转ws,服务器端不需要做修改 server { listen 9990; server_name xx.xx.xx.xx; ssl on; ssl_certificate "/usr/cert/barrage.crt"; ssl_certificate_key "/usr/cert/barrage.key"; ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_prefer_server_ciphers on; location /{ #反向代理到9999端口,同时协议转换为http,这样服务器端代码就不需要做修改 proxy_pass http://120.77.222.242:9999; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; #由于服务器端源码(建议大家做好大小写匹配)只匹配了"Upgrade"字符串,所以如果这里填"upgrade"服务器端会将这条http请求当成普通的请求,导致websocket握手失败 proxy_set_header Connection "Upgrade"; proxy_set_header Remote_addr $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_read_timeout 600s; } }
                                      Run code
                                      Cut to clipboard
                                        文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-09-03, 18:19:44  
                                        展开↯

                                        #355

                                        作者:广东省深圳市
                                        good
                                        文章:各大搜索引擎搜索框提示代码支持https  发表时间:2019-08-28, 15:50:40  
                                        展开↯

                                        #356

                                        作者:浙江省丽水市
                                        d
                                        #,广西崇左市扶绥县,2019-08-13,18:00:18,
                                        文章:PHP: scandir()按照时间排列的方法  发表时间:2019-08-02, 09:34:32  
                                        展开↯

                                        #357

                                        作者:浙江省杭州市
                                        啦啦啦啦啦啦啦啦啦啦叽叽叽叽叽叽叽
                                        #,广西贵港市,2019-07-25,08:28:01, 你像极了给皇军带路的人
                                        文章:JS字符串与二进制相互转化转换  发表时间:2019-05-14, 17:41:30  
                                        展开↯

                                        #358

                                        作者:广东省深圳市
                                        code
                                        Run code
                                        Cut to clipboard
                                          #,广西贵港市,2019-07-25,08:27:35, 你像极了给皇军带路的人
                                          文章:JS字符串与二进制相互转化转换  发表时间:2019-07-20, 16:18:12  
                                          展开↯

                                          #359

                                          作者:广西南宁市
                                          客服消息
                                          <button open-type="contact" bindcontact="handleContact"></button> Page({ handleContact (e) { console.log(e.path) console.log(e.query) } })
                                          Run code
                                          Cut to clipboard

                                            在页面使用客服消息
                                            需要将 button 组件 open-type 的值设置为 contact,当用户点击后就会进入客服会话,如果用户在会话中点击了小程序消息,则会返回到小程序,开发者可以通过 bindcontact 事件回调获取到用户所点消息的页面路径 path 和对应的参数 query。

                                            path 小程序消息指定的路径
                                            query 小程序消息指定的查询参数
                                            #,广西南宁市,2019-07-13,15:07:38,
                                            修改 return $_GET["echostr"]
                                            return回来的echostr是带双引号,而echo回来的echostr是不带双引号的。
                                            文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-07-13, 15:06:17  
                                            展开↯

                                            #360

                                            作者:广西南宁市
                                            使用bootstrap carousel时的"Cannot read property 'offsetWidth' of undefined"问题
                                            Remove the data-ride="carousel" attribute to fix JS error
                                            Run code
                                            Cut to clipboard

                                              Bootstrap Carousel: Uncaught TypeError: Cannot read property 'offsetWidth' of undefined
                                              #,广西南宁市,2019-06-27,17:14:49, “列表左滑”对往上方滑屏过于敏感
                                              改动一下 // ListTouch计算方向 ListTouchMove(e) { this.setData({ ListTouchDirection: e.touches[0].pageX - this.data.ListTouchStart > 0 ? 'right' : 'left' }) }, 这段,改成例如 // ListTouch计算方向 ListTouchMove(e) { var offset = e.touches[0].pageX - this.data.ListTouchStart if (offset > 50) { this.setData({ ListTouchDirection: 'right' }) } else if (offset < -50) { this.setData({ ListTouchDirection: 'left' }) } } 提高触发的偏移值就可以了。
                                              Run code
                                              Cut to clipboard
                                                cu-custom作为小程序头部在IOS下会被拉动;且偶尔会整体偏移向上,目测是因为padding的部分被偏移出屏幕导致的,且下拉不会回来。
                                                #,广西南宁市,2019-07-04,17:44:25, 在使用Laravel框架的时候,调试的时候,需要将查询的SQL输出校验,这是需要将SQL打印出来
                                                DB::connection()->enableQueryLog(); // 开启查询日志 DB::table('my_table')->insert($data); // 要查看的sql语句执行 $logs = DB::getQueryLog(); // 获取查询日志 dd($logs); // 即可查看执行的sql,传入的参数等等
                                                Run code
                                                Cut to clipboard

                                                  Laravel 系列:orWhere 条件式
                                                  ->where(function ($query) use ($keyword) { $query->where('name', 'like', "%{$keyword}%")->orWhere('barcode', 'like', "%{$keyword}%"); })
                                                  Run code
                                                  Cut to clipboard

                                                    foreach()循环
                                                    要跳出本次循环继续执行下次循环 continue
                                                    终止循环
                                                    break。
                                                    文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-06-20, 17:10:35  
                                                    展开↯

                                                    #361

                                                    作者:广西河池市
                                                    $roomUuid = 1; $chatInfo = DB::table('chat_info') ->where('chat_info.room_uuid', $roomUuid) ->leftJoin('user_rooms', function ($join) { $join->on('user_rooms.user_uuid', '=', 'chat_info.user_uuid') ->on('user_rooms.room_uuid', '=', 'chat_info.room_uuid'); })
                                                    Run code
                                                    Cut to clipboard
                                                      文章:Laravel 5.4 结合 Workerman 实现 TCP 长连接  发表时间:2019-06-06, 00:53:48  
                                                      展开↯
                                                      你好,残忍屏蔽广告

                                                      确定要清除编辑框内容吗?

                                                      该删除操作将不可恢复。

                                                      删除 取消

                                                      激活Windows

                                                      转到"设置"以激活Windows。