|
@@ -48,17 +48,22 @@ class Notification extends BaseModel
|
|
if($overdue) {
|
|
if($overdue) {
|
|
$project_role_ids = ProjectRole::whereIn('key', ['machine', 'admin'])->pluck('id');
|
|
$project_role_ids = ProjectRole::whereIn('key', ['machine', 'admin'])->pluck('id');
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ \Log::info($user_ids);
|
|
if(count($project_role_ids) > 0) {
|
|
if(count($project_role_ids) > 0) {
|
|
//如果拒绝只给创建人提醒
|
|
//如果拒绝只给创建人提醒
|
|
if($order->status == 4){
|
|
if($order->status == 4){
|
|
$user_ids = [$order['user_id']];
|
|
$user_ids = [$order['user_id']];
|
|
|
|
+ } else if($order->type == 2&&$order->level == 7&&$order->status ==2&&$order->last_project_role_id ==4){//项目经理通过审核的调用订单,消息提醒机电负责人
|
|
|
|
+ $user_ids = [$order['user_id']];
|
|
} else {
|
|
} else {
|
|
$user_ids = ProjectUser::where([
|
|
$user_ids = ProjectUser::where([
|
|
['project_id', $order['project_id']]
|
|
['project_id', $order['project_id']]
|
|
])->whereIn('project_role_id', $project_role_ids)->pluck('user_id');
|
|
])->whereIn('project_role_id', $project_role_ids)->pluck('user_id');
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ \Log::info($user_ids);
|
|
// 外部租赁
|
|
// 外部租赁
|
|
if($order['type'] == 1) {
|
|
if($order['type'] == 1) {
|
|
// 审批成功
|
|
// 审批成功
|
|
@@ -142,6 +147,8 @@ class Notification extends BaseModel
|
|
public static function createAndSend($data)
|
|
public static function createAndSend($data)
|
|
{
|
|
{
|
|
$item = Notification::create($data);
|
|
$item = Notification::create($data);
|
|
|
|
+ \Log::info($data['user_id']);
|
|
|
|
+ \Log::info('user_id');
|
|
$item->sendOfficialInfo();
|
|
$item->sendOfficialInfo();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -149,6 +156,8 @@ class Notification extends BaseModel
|
|
{
|
|
{
|
|
$content = $this->getNameContent();
|
|
$content = $this->getNameContent();
|
|
$user = User::find($this['user_id']);
|
|
$user = User::find($this['user_id']);
|
|
|
|
+ \Log::info($user);
|
|
|
|
+ \Log::info('------');
|
|
$official_app = app('wechat.mini_program.default');
|
|
$official_app = app('wechat.mini_program.default');
|
|
if($content && isset($content['official']) && $user && $user['open_id']) {
|
|
if($content && isset($content['official']) && $user && $user['open_id']) {
|
|
$info = $content['official'];
|
|
$info = $content['official'];
|