Commit 12b19af2 authored by hujun's avatar hujun

消息

parent efd4b380
......@@ -634,4 +634,41 @@ class PushMessageService
$m_push->updateData($update_data, ['id' => ['in', $id_array]]);
}
}
/**
* 新增处罚 推送
*
* @param $agent_id
* @param $id
* @param $operation_id
* @return bool
*/
public function pushAmercementMessage($agent_id, $id, $operation_id)
{
if (empty($agent_id)) {
return false;
}
$agent_id_arr[] = $agent_id;
$record_data['message'] = '您有一笔罚款需要支付,罚款编号:'.$id;
$record_data['title'] = '新增处罚';
$s_redis = new RedisCacheService();
$agent_data = $s_redis->getRedisCache(2, $agent_id);
if (!empty($agent_data)) {
$m_agent = new AAgents();
$where['store_id'] = $agent_data['store_id'];
$where['level'] = ['in', '20,40'];
$where['status'] = 0;
$store_agent_id = $m_agent->getFieldOneValue('id', $where);
if ($store_agent_id) {
$agent_id_arr[] = $store_agent_id;
}
}
$this->recordCheck(6, $agent_id_arr, $operation_id, $record_data);
return true;
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@
namespace app\index\service;
use app\api_broker\service\PushMessageService;
use app\model\OAmercementImgModel;
use app\model\OAmercementModel;
......@@ -26,8 +27,10 @@ class AmercementService
/**
* 新增
*
* @param $params
* @return bool
* @param $submit_agent_id
* @return int|string
*/
public function addAmercement($params,$submit_agent_id)
{
......@@ -37,8 +40,11 @@ class AmercementService
$params_['submit_agent_id'] = $submit_agent_id;//提交人
$params_['agent_id'] = $params['agent_id'];//被罚款人
$params_['remarks'] = $params['remarks'];//备注
$res = $this->m_amercement->saveAmercement($params_);
return $res;
$id = $this->m_amercement->saveAmercement($params_);
$push = new PushMessageService();
$push->pushAmercementMessage($params['agent_id'], $id, $submit_agent_id); //推送
return $id;
}
/**
......
......@@ -22,7 +22,7 @@ class OAmercementModel extends Model
$data['create_time'] = $time;
$data['update_time'] = $time;
$data['is_del'] = 0;
return $this->db_ ->insertGetId($data);
return $this->db_->insertGetId($data);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment