作者 李宇航

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

Lyh server



查看合并请求 !3331
... ... @@ -9,7 +9,6 @@
namespace App\Http\Logic\Aside\Geo;
use App\Enums\Common\Code;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoConf;
use App\Models\Geo\GeoConfirm;
... ... @@ -43,7 +42,7 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$wechat = $param['wechat'] ?? true;
$wechat = $param['wechat'] ?? 1;
unset($param['wechat']);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
... ...
... ... @@ -65,9 +65,11 @@ class GeoWritingsLogic extends BaseLogic
$this->param['status'] = GeoWritings::STATUS_INIT;
if(isset($this->param['id']) &&!empty($this->param['id'])){
$id = $this->param['id'];
$this->param['content_length'] = strlen($this->param['content'] ?? '');
$this->model->edit($this->param,['id'=>$id]);
}else{
$this->param['type'] = GeoWritings::TYPE_SUBMIT;
$this->param['content_length'] = strlen($this->param['content'] ?? '');
$this->param['uniqid'] = uniqid().$this->param['project_id'];
$id = $this->model->addReturnId($this->param);
}
... ... @@ -102,7 +104,7 @@ class GeoWritingsLogic extends BaseLogic
*/
public function sendWechatMessage()
{
$wechat = $this->param['wechat'] ?? true;
$wechat = $this->param['wechat'] ?? 1;
$this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
$data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
if($data === false){
... ...
... ... @@ -38,7 +38,7 @@ class GeoWritingsTaskRequest extends FormRequest
// 'prefix' => 'required|string',
// 'suffix' => 'required|string',
'event_title' => 'required|string',
'event_content' => 'required|string',
// 'event_content' => 'required|string',
'title' => 'required|string|max:120',
'description' => 'required|string',
];
... ...
... ... @@ -106,7 +106,7 @@ class GeoConfirm extends Base
* @param $id
* @return bool
*/
public static function sendConfirmMessage($id, $friend_id,$send = true)
public static function sendConfirmMessage($id, $friend_id,$send = 1)
{
$data = self::where(compact('id'))->first();
$project_id = $data->project_id;
... ... @@ -127,7 +127,7 @@ class GeoConfirm extends Base
'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token
];
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
if($send == true){
if($send){
$data->send_at = now();
$data->status = self::STATUS_RUNNING;
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
... ...
... ... @@ -77,7 +77,7 @@ class GeoWritings extends Base
* @return bool
* @throws \Exception
*/
public static function sendConfirmMessage($project_id,$wechat = true)
public static function sendConfirmMessage($project_id,$wechat = 1)
{
$friend = ProjectAssociation::where(['project_id' => $project_id])->first();
if (empty($friend)) {
... ...