迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
文章发布开启审核功能的时候,第一级审核人审核通过后提醒下一级审核人的微信提醒
public function _call_verify($data, $verify) {
/* 提醒代码 */
\Phpcmf\Service::L('Notice')->send_notice('shtx', $data);
}
<?php namespace Phpcmf\Model\Test; // 模块内容模型类 class Content extends \Phpcmf\Model\Content { // 内容审核操作之后 public function _call_verify($data, $verify) { $step = $this->_get_verify($data['uid'], $data['catid']); $step[9] = [ 'name' => dr_lang('完成'), ]; $next = dr_count($step) - 1 <= $data['status'] ? 9 : $data['status'] + 1; if ($next < 9 && $step[$next]['rid']) { // 通知此角色组下面的全部账号 $user = $this->table('admin_role_index')->where('roleid', $step[$next]['rid'])->getAll(); if ($user) { foreach ($user as $t) { // 微信模板消息通知 \Phpcmf\Service::M('member')->weixin_template($t['uid'], 'Lp2EsbCMCt0jKdZhnHRPYXRuKEETE9sh96RC9hKflmA', [ 'first' => [ 'value' => '会员充xxxxxxxxxxxx值信息', 'color' => '#173177', ], 'accountType' => [ 'value' => '账号', 'color' => '#173177', ], 'account' => [ 'value' => 'admin', 'color' => '#173177', ], 'amount' => [ 'value' => '8888元', 'color' => '#173177', ], 'result' => [ 'value' => '充值成功', 'color' => '#173177', ], 'remark' => [ 'value' => '如有疑问,请联系我们。', 'color' => '#173177', ], ] ); } } } } // 获取当前栏目的时候流程 private function _get_verify($uid, $catid) { $auth = \Phpcmf\Service::C()->member_cache['auth_module'][SITE_ID][MOD_DIR]['category'][$catid]['verify']; $cache = \Phpcmf\Service::C()->get_cache('verify'); if ($cache && $auth) { $verify = []; $authid = \Phpcmf\Service::M('member')->authid($uid); foreach ($authid as $aid) { if (isset($auth[$aid]) && $auth[$aid] && isset($cache[$auth[$aid]])) { $verify = $cache[$auth[$aid]]; break; // 找到最近的审核机制就ok了 } } $rt = []; if ($verify['value']['role']) { $role = \Phpcmf\Service::C()->get_cache('auth'); foreach ($verify['value']['role'] as $id => $rid) { $rt[$id] = [ 'rid' => $rid, 'name' => dr_lang($role[$rid]['name'] ? $role[$rid]['name'] : '管理员'), ]; } } return $rt; } return []; } }