添加 reply#text: 回复规则

This commit is contained in:
Anyon 2020-10-11 16:27:11 +08:00
parent 1947451b98
commit dd6c77bd13

View File

@ -196,6 +196,10 @@ class Push extends Controller
*/
private function _keys(string $rule, bool $last = false, bool $custom = false)
{
if (stripos($rule, 'reply#text:') === 0) {
[, $content] = explode('#text:', $rule);
return $this->_buildMessage('text', ['Content' => $content]);
}
[$table, $field, $value] = explode('#', $rule . '##');
$data = $this->app->db->name($table)->where([$field => $value])->find();
if (empty($data['type']) || (array_key_exists('status', $data) && empty($data['status']))) {