windows git 换行符
1git config --global core.autocrlf input https://www.cnblogs.com/youpeng/p/11243871.html
换系统步骤
备份秘钥 备份代码 备份文档 备份图片视频
微信小程序 input 错位 placeholder 层级过高
input错位 原因微信小程序输入时候,会自动上推页面,会出现这个奇怪的问题 解决只要让整个页面可以自动撑开即可,比如最外层的container不要限制高度 placeholder层级只要给不想被错误覆盖的元素一个z-index
git 用远端覆盖本地
https://blog.csdn.net/sinat_36184075/article/details/80115000 123git fetch --allgit reset --hard origin/mastergit pull 不切换分支直接he’bing 123git fetch origingit merge origin/guojin/newemail
yii2 时间戳 修改格式 使用字符串
1234567891011121314public function behaviors(){ $behaviors = parent::behaviors(); $time = [ 'class' => \yii\behaviors\TimestampBehavior::class, 'value' => fn () => date('Y-m-d H:i:s'), 'attributes' => [ \yii\db\ActiveRecord::EVENT_BEFORE_INSERT => ['create_time', 'update_time'], \yii\db\ActiveRecord::EVENT_BEFORE_UPDATE => ['update_time'], ...
全国省市区行政区划数据
https://github.com/modood/Administrative-divisions-of-China https://gitee.com/shadowy/china-city
yii2 依赖注入 自动装配
Yii2对象123456public function __construct( public AssetLogic $logic, $config = [],) { parent::__construct($config);} 控制器 包括命令行和web 12345678public function __construct( $id, $moudule, $config, public AssetLogic $assetLogic,) { parent::__construct($id, $moudule, $config);}
产品感悟
很多产品都是”滤镜”,比如:mbti心理测试,实际上就是说用户好话,让用户便于分享.类似于照片美颜
yii2 只更新时间戳
1$patient->touch(['update_time']);
laravel 输出时间戳timestamps总是格式错误
可以在输出前配置 1234protected $casts = [ 'created_at' => 'datetime:Y-m-d h:i:s', 'updated_at' => 'datetime:Y-m-d h:i:s',];