- 博客(20)
- 收藏
- 关注
原创 python 打开手机,并滑动,抖音自动刷视频
from Devices import Devicesfrom multiprocessing import Processfrom phoneTools import phoneToolsimport time'''author--Jenson'''if __name__ == '__main__': DevicesObj = Devices() devices = DevicesObj.execShell('adb devices') deviceReadL.
2021-01-26 14:52:28
680
原创 当您 composer 安装或者更新时报错提示 killed 时,这是因为当前服务器内存不足,增加内存即可。
free -m// total used free shared buff/cache available// Mem: 1838 427 858 46 552 1217// Swap: 1023 304 719mkdir -p /var/_swap_cd /var/_swap...
2020-07-30 10:18:49
325
原创 Yii2 使用updateAll批量修改不触发 afterSave()
afterSave() is thought for a single record. updateAll() handles many records in a completly different way. So you cannot use afterSave() this way. Imagine: when you update thousands of records this way, the afterSave() methods would need to be executed for
2020-05-09 14:47:14
984
原创 Yii2 rbac 权限
<?phpnamespace common\Services;use Yii;class RbacService extends Services { private $Auth; protected $CreatePost; protected $Admin; protected $Author; protected $authIte...
2020-04-24 10:20:18
126
原创 微信小程序分享朋友
onShareAppMessage: function onShareAppMessage(e) { var title = '点击立即获取今日油价信息'; return { title: title, path: 'pages/index/index' }}
2020-04-22 19:11:25
201
原创 Yii relations 的基本使用
<?phppublic function getGoodsCat() { return $this->hasOne(GoodsCat::class, ['cat_id' => 'goods_cat_id']);}
2020-04-22 18:53:58
137
原创 自改Yii2 gii脚手架
<?php/** * This is the template for generating the model class of a specified table. *//* @var $this yii\web\View *//* @var $generator yii\gii\generators\model\Generator *//* @var $tableNam...
2020-04-22 18:42:17
105
原创 php 之mongo的使用
<?php'mongodb' => [ 'class' => '\yii\mongodb\Connection', 'dsn' => 'mongodb://myAdmin:666666@127.0.0.1:27017/admin', //myAdmin是用户名,666666是密码 27017是端口号 admin是数据库名],/*...
2020-04-22 18:33:53
109
原创 自写框架之入口文件
<?phpuse controllers\Base;/* * Here is the import profile * **/$config = (object)array_merge( require_once "./config/db.php", require_once "./config/config.php");(new Base())-&...
2020-04-22 18:24:06
97
原创 Yii2 event 事件的用法
public function onPaySuccess($event) { echo $event->data['msg']; return $event->handled;}public function test() { $this->on(self::ON_PAY_SUCCESS, [$this, 'onPaySuccess'], ['ms...
2020-04-22 18:18:53
361
原创 微信公众号配置服务器TOKEN
/* * 验证token * **/public function actionIndex() { $WechatSer = new WechatService(); $WechatSer->setParams('signature', $this->params["signature"]); $WechatSer->setParams('time...
2020-04-22 18:01:32
235
原创 Yii2 发送邮件简单使用
static public function getEmail() { if (empty(self::$_Email)) { self::$_Email = Yii::$app->mailer->compose(); } return self::$_Email;}/* * 发送邮件 * **/static public f...
2020-04-22 17:57:16
151
原创 sql 语句中计算时间
SELECT * FROM t_device_task tdt LEFT JOIN t_device_inspecttask tdi ON tdt.inspecttask_id = tdi.inspecttask_id LEFT JOIN t_device_report tdr ON tdi.report_id = tdr.report_id WHERE tdt.tas...
2018-07-11 17:04:58
1301
1
原创 配置yii2 log日志
'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' ...
2018-07-03 11:30:26
1578
转载 安装composer
composer windows安装,使用新手入门2017年02月07日 16:48:47阅读数:22433 一.前期准备:1.下载安装包,https://getcomposer.org/download/2.在php.ini文档中打开extension=php_openssl.dll3.下载php_ss...
2018-06-05 17:30:47
609
原创 Js 上传遇到Access control allow origin 问题
后端php文件加上 header("Access-Control-Allow-Origin: *");
2018-04-27 15:44:41
625
转载 PHP 的注释
/*** @name 名字* @abstract 申明变量/类/方法* @access 指明这个变量、类、函数/方法的存取权限* @author 函数作者的名字和邮箱地址* @category 组织packages* @copyright 指明版权信息* @const 指明常量* @deprecate 指明不推荐或者是废弃的信息* @example 示例* @exclude 指明当前的注释将不进行...
2018-04-09 11:06:43
217
转载 有趣的算法
1、首先来画个菱形玩玩,很多人学C时在书上都画过,咱们用PHP画下,画了一半。 思路:多少行for一次,然后在里面空格和星号for一次。 <?php for($i=0;$i<=3;$i++){ for($j=0;$j<=3-$i;$j++){ echo '&nbsp;'; } for($k=0;$k<=2*$i;$k++){ ec...
2018-04-09 10:59:34
427
原创 php 算法
<? //-------------------- // 基本数据结构算法 //-------------------- //二分查找(数组里查找某个元素) function bin_sch($array, $low, $high, $k){ if ( $low <= $high){ $mid = intval((...
2018-04-09 10:58:07
75
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人