作者 李宇航

合并分支 'lyh-server' 到 'master'

变更数据



查看合并请求 !3185
... ... @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$wechat = $param['wechat'];
$wechat = $param['wechat'] ?? true;
unset($param['wechat']);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
... ...
... ... @@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic
*/
public function sendWechatMessage()
{
$wechat = $this->param['wechat'] ?? true;
$this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
$data = GeoWritings::sendConfirmMessage($this->param['project_id']);
$data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
if($data === false){
$this->fail('项目未绑定微信群');
}
... ...
... ... @@ -77,7 +77,7 @@ class GeoWritings extends Base
* @return bool
* @throws \Exception
*/
public static function sendConfirmMessage($project_id)
public static function sendConfirmMessage($project_id,$wechat = true)
{
$friend = ProjectAssociation::where(['project_id' => $project_id])->first();
if (empty($friend)) {
... ... @@ -104,9 +104,11 @@ class GeoWritings extends Base
'thumbUrl' => 'https://hub.globalso.com/logocm.png',
'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token
];
if($wechat){
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
return true;
}
return $content_array;
}
}
... ...