分类 成长之路 中的文章

laravel lumen with 软删除的数据

重点:$query->withTrashed(); $info = self::with('userInfo', 'express.company') ->with(['product' => function ($query) { $query->withTrashed(); }]) ->where($where) ->select(['id', 'type', 'user_id', 'order_sn', 'membership_card_type', 'membership_card_id', 'membership_card_info', 'membership_card_offer_fee', 'coupon_id', 'coupon_info', 'coupon_offer_fee', 'original_price', 'delivery_fee', 'pay_type', 'price', 'remarks', 'status', 'extend_info', 'created_at']) ->orderBy('id', 'desc') ->first();……

阅读全文

lumen cors跨域问题

1,创建CrossHttp中间件 <?php /** * Created by PhpStorm. * User: cnbattle * Date: 18-10-22 * Time: 下午12:40 */ namespace App\Http\Middleware; use Closure; class CrossHttp { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param Closure $next * @return mixed */ public function handle($request, Closure $next) { if ($request->getMethod() == "OPTIONS") { $allowOrigin = [ 'http://admin.580xb.cn', ]; $Origin = $request->header("Origin"); if (in_array($Origin, $allowOrigin)) { return response()->json('ok', 200, [ # 下面参数视request中header而定 'Access-Control-Allow-Origin' => $Origin, 'Access-Control-Allow-Headers' => 'x-requested-with,content-type,Authorization,CityCode', 'Access-Control-Allow-Methods' => 'POST,DELETE,GET,PUT,OPTIONS']); } else { return response()->json('fail', 405); } } $response = $next($request); $response->header('Access-Control-Allow-Origin', '*'); return $response; } } 2……

阅读全文

HTTP状态码大全

1xx:信息响应类,表示接收到请求并且继续处理 2xx:处理成功响应类,表示动作被成功接收、理解和接受 3xx:重定向响应类,为了完成指定的动作,必须接受进一步处理 4xx:客户端错误,客户请求包含语法错误或者是不能正确执行 5xx:服务端错误,服务器不能正确执行一个正确的请求 1xx(信……

阅读全文

linux crontab命令详解

crontab命令被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程,crond进程每分钟会定期检查是否有要执行的任务,如果有要执行的任务,则自动执行该任务。 #语法 crontab(……

阅读全文

oneinstack helper

oneinstack help ./install.sh version: 1.7 updated date: 2018-04-20 Usage: ./install.sh command ...[parameters].... --help, -h Show this help message, More: https://oneinstack.com/auto --version, -v Show version info --nginx_option [1-3] Install Nginx server version --apache_option [1-2] Install Apache server version --php_option [1-7] Install PHP version --phpcache_option [1-4] Install PHP opcode cache, default: 1 opcache --php_extensions [ext name] Install PHP extension, include zendguardloader,ioncube,imagick,gmagick --tomcat_option [1-4] Install Tomcat version --jdk_option [1-4] Install JDK version --db_option [1-15] Install DB version --dbinstallmethod [1-2] DB install method, default: 1 binary install --dbrootpwd [password] DB super password --pureftpd Install Pure-Ftpd --redis Install Redis --memcached Install Memcached --phpmyadmin Install phpMyAdmin --hhvm Install HHVM --ssh_port [22] SSH port, default: 22 --iptables Enable iptables --reboot Restart the server after installation ./vhost.sh Usage: ./vhost.sh [ add | del | list | dnsapi ] add --->Add Virtualhost del --->Delete Virtualhost list --->List Virtualhost dnsapi……

阅读全文

两种判断shell执行用户是否为root用户

方式一: # Check if user is root if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use root to run" exit 1 fi 方式二: # Check if user is root [ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }……

阅读全文

统计代码git提交的行数

统计某人的代码提交量,包括增加,删除: git log --author="$(git config --get user.name)" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' - 仓库提交者排名前 5(如果看全部,去掉 head 管道即可): git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5 仓库提交者(邮箱)排名前 5:这个统计可能不会太准,因为很多人有不同的邮箱,但会……

阅读全文

最近文章

分类

标签

ADB CSS Chrome DNS Docker FreeBSD Git Go Golang K8S Laravel Linux Lumen MySQL Nginx PHP PowerISO RSS订阅 ThinkPHP ubuntu Windows acme.sh adminer amis android anyproxy argo-cd canal ceph codeigniter codex coredns crontab cryptomator dapr dbeaver eclipse electron etcd fastboot ffmpeg gin gitea goquery gorm gorse grafana grpc grpc-gateway harness helm html hugo jaeger java javaee javascript jetbrains jquery js k3s kubernetes let's encrypt library license server longhorn meilisearch nodejs oneinstack open-webui openchamber opencode phpmyadmin phpstorm pi podman pritunl prometheus recovery redis release reset resty rook rufus screen shell ssl supervisor traefik trarfik twrp typecho ubuntu ueditor unzip vagrant vim virtualbox vitess xmind zip zsh 七牛云 下载 产品 从零开始 代理 何时 分区 初体验 刷机 压缩 启动 启动盘 命令 命令大全 命令行 坑 增量订阅 墨刀 好不好 学习路线 安装 实例 密码 小程序 工具 常用命令 开发 开始 引导 微信 微信第三方 快捷键 思维导图 怡和 怡和物业 成立 成长之路 技能树 抖音 指向 授权 排错 推广 提升 搜索 效率 文件 新手 新用户 方案 昆明 昆明水库 最新活动 权限 水库 泛域名 流程图 消费组件 润城 激活 爬虫 版本更新 狼人杀 磨刀 程序 笔记本 管理 米粉卡 系统 终身会员 维修 编程 老用户 联通 自加 解压 解析 设计 设计规范 证书 详解 语法 跨域 软件 迁移 钓鱼 阿里云 面板

友情链接

其它