git 删除分支 $ git push origin --delete fix-0623-vouchergitTo http://git.shall-buy.top/xiaoba/car-v2 - [deleted] fix-0623-voucher$ git branch -D fix-0623-voucherDeleted branch fix-0623-voucher (was e26ad85).
Illuminate\Support\Collection 去重 unique 列表去重 列表, 数组 指定规则去重curMsg->getFundId() == $prevMsg->getFundId()重复后处理// 删除哪个元素?if ($curMsg->created_at > $prevMsg->created_at) { // 待删除的元素移动到后面 self::swap($list, $i, $dupIdx);}可替换部分如上.........
Laravel log channel 分组配置 use Illuminate\Support\Facades\Log;Log::channel('vehicle')->info('==xxx任务开始==');config/logging.phpchannels配置项中添加vendor/laravel/framework/src/Illuminate/Log/LogManager.php
Laravel 权限导出 ./app/Console/Commands/ExportPermission.phpphp artisan permission:migrate # php artisan export:permission staff日志:database/permission/permission.log SQL:database/permission/permission.sql
laravel migration 修改字段 php artisan make:migration ... php artisan make:migration alter_sources_description --table=life_car_sourcesphp artisan migratephp artisan migrate:rollback --step=1 # 回滚变更<?phpuse Illuminate\Database\Migrations\Migration;use Illuminate\Database\Schema\Blueprint;use Illumi.
Uncaught InvalidArgumentException: Please provide a valid cache path. in /apps/vendor/laravel/framew cd 项目路径mkdir -p ./storage/framework/cachemkdir -p ./storage/framework/sessionsmkdir -p ./storage/framework/viewsDockerfileFROM vendor:7.4prodCOPY . /apps/RUN mkdir -p /apps/storage/framework/laravel-excel && chown www-data:www-data /app
mysql JSON类型取值 location字段是json类型location json not null示例数据内容:{"city": {"code": "330100", "name": "杭州市"}, "province": {"code": "33000", "name": "浙江省"}}要查杭州市的select * from life_car_sourceswhere location-&
redis 锁 PHP防止重复请求 use Illuminate\Support\Facades\Cache;// CACHE_DRIVER=redis$key = sprintf("carV2:panic_addSubsidy:%d", $value->getId());$lock = Cache::lock($key, 20);if (!$lock->get()) { throw \ExceptionFactory::business(CodeMessageConstant::PANIC_ORDER_...
docker 添加挂载目录 mount /mnt /Volume workspace: docker开发环境~/gitee.com/mxycool/workspace/docker-compose.yml添加 - '/Volumes:/mnt'$ docker-compose down$ docker-compose up -d把本机/Volumes 挂载到 容器的 /mnt[root@workspace: /mnt/老毛桃U盘] #
SnowFlake.php * SnowFlake.php<?phpnamespace CarV2\Utils;class SnowFlake{ const START_STAMP = 1640966400000; // "2022-01-01" const SEQUENCE_BIT = 12; // 序列号占用的位数 const MACHINE_BIT = 5; // 机器标识占用的位数 const DATACENTER_BIT = 5; // 数据中心占用的位数
Redis hmset, hmget <?phpuse Illuminate\Support\Facades\Redis;// ... public static function getByIdWithCache($id) { Redis::select(6); $key = sprintf("CarV2:MERCHANT:%d", $id); $columns = array( "id", "merchant_type_id","member_username","...
php上传文件到七牛云 php上传文件到七牛云use zgldh\QiniuStorage\QiniuStorage;use \Illuminate\Http\UploadedFile; public function uploadImage(UploadedFile $image, string $disk, string $filePath) { /** @var $qiniu \zgldh\QiniuStorage\QiniuStorage */ $qiniu = Qini
could not unmarshal event: unknown PrivateNetworkRequestPolicy value /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --disable-gpu --headless{ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.
git 比较分支 Compare two branches using git diffIn order to compare two branches easily, you have to use the “git diff” command and provide the branch names separated by dots.$ git diff branch1..branch2Using this command, Git will compare the tip of both branche
根据经纬度计算2个地理位置的距离 * Math.php<?phpnamespace CarV2\Utils\Geo;class Math{ const PI = 3.14159265258979; public static function abs($x) { return $x < 0 ? -$x : $x; } public static function sqrt($x, $err=1e-15) { if ($x < 0) {
libcurl error codes libcurl error codesNamelibcurl-errors - error codes in libcurlDescriptionThis man page includes most, if not all, available error codes in libcurl. Why they occur and possibly what you can do to fix the problem are also included.CurlcodeAlmos