Giter Site home page Giter Site logo

think-helper's People

Contributors

4352570 avatar 52fhy avatar 9007967 avatar acrossmountain avatar cheerego avatar larvacent avatar liu21st avatar liuqiandev avatar nhzex avatar yunwuxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

think-helper's Issues

Time 类BUG

昨日的开始结束时间的写法没有考虑到,跨月的情况。
上个月的开始结束时间的写法没有考虑到,跨年的情况。

3.1.2开始突然怎么变成要php7.1了,thinkphp5.1依赖的的think-queue2.0直接将tp5.1的要求提升到了php7.1

{
    "name": "topthink/think-queue",
    "description": "The ThinkPHP5 Queue Package",
    "type": "think-extend",
    "authors": [
        {
            "name": "yunwuxin",
            "email": "[email protected]"
        }
    ],
    "license": "Apache-2.0",
    "autoload": {
        "psr-4": {
            "think\\": "src"
        },
        "files": [
            "src/common.php"
        ]
    },
    "require": {
        "topthink/think-helper": ">=1.0.4",
        "topthink/think-installer": "^2.0",
        "topthink/framework": "5.1.*"
    },
    "extra": {
        "think-config": {
            "queue": "src/config.php"
        }
    }
}

Collection类first方法注释错误

/**
* 获取最第一个单元数据
*
* @access public
* @param callable|null $callback
* @param null $default
* @return mixed
*/
public function first(callable $callback = null, $default = null)
{
return Arr::first($this->items, $callback, $default);
}

注释多了一个最字?

Arr类建议增加汇总多维数组中某个键子集相同的子数组的方法

/**
	 * 汇总某个子集相同的到同一维
	 * @param array $array 输入的数组
	 * @param string $column 判断相同值的字段名
	 * @return array
	 */
	public static function gather($array, $column)
	{
		$data = [];
		
		if ($array) {
			foreach ($array as $item) {
				if (!is_array($item) || !self::exists($item, $column)) return [];
				$data[$item[$column]][] = $item;
			}
		}
		
		return $data;
	}


$data = [
			['id' => 2, 'aid' => 3, 'cid' => 9],
			['id' => 2, 'aid' => 5, 'cid' => 11],
		];

var_dump(Arr::gather($data, 'id'));

结果

array:1 [
  2 => array:2 [
    0 => array:3 [
      "id" => 2
      "aid" => 3
      "cid" => 9
    ]
    1 => array:3 [
      "id" => 2
      "aid" => 5
      "cid" => 11
    ]
  ]
]

Collection得order方法排序有问题

    public function order(string $field, string $order = 'asc')
    {
        return $this->sort(function ($a, $b) use ($field, $order) {
            $fieldA = $a[$field] ?? null;
            $fieldB = $b[$field] ?? null;

//
            return 'desc' == strtolower($order) ? intval($fieldB > $fieldA) : intval($fieldA > $fieldB);
        });
    }

代码中结果,只有0和1,没有-1得

改一下验证码读取session的错误吧

password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated

是否为bug

为什么session.php配置store为redis,序列化参数也改为'serialize'=>['json_encode', 'json_decode']之后,居然无法使用验证函数,请问这算是BUG吗, 报错:password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated

// /vendor/topthink/think-captcha/src/Captcha.php
将 $key = $this->session->get('captcha.key');
改成
$arr = $this->session->get('captcha');
$key = $arr->key;
就可以了

修改了一下代码,麻烦大佬修复一下。

文件: /vendor/topthink/think-helper/src/helper/Arr.php
方法: public static function get($array, $key, $default = null)
修改:
if (is_object($array[$segment])) {
$array = (array) $array[$segment];
} else {
$array = $array[$segment];
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.