GeoWritingsLogic.php
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* @remark :
* @name :GeoWritingsLogic.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:43
*/
namespace App\Http\Logic\Aside\Geo;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoWritings;
/**
* @remark :文章任务
* @name :GeoWritingsLogic
* @author :lyh
* @method :post
* @time :2025/10/25 10:44
*/
class GeoWritingsLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new GeoWritings();
}
/**
* @remark :列表数据
* @name :listWriting
* @author :lyh
* @method :post
* @time :2025/10/25 15:57
*/
public function listWriting($map,$page,$row,$order){
$data = $this->model->lists($map,$page,$row,$order);
return $this->success($data);
}
/**
* @remark :手动上传数据
* @name :saveWriting
* @author :lyh
* @method :post
* @time :2025/10/25 16:07
*/
public function saveWriting(){
try {
$this->param['status'] = GeoWritings::STATUS_INIT;
if(isset($this->param['id']) &&!empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
}else{
$this->param['uniqid'] = uniqid().$this->param['project_id'];
$id = $this->model->addReturnId($this->param);
}
}catch (\Exception $e){
$this->fail('保存数据失败,请联系管理员'.$e->getMessage());
}
return $this->success(['id'=>$id]);
}
/**
* @remark :删除数据
* @name :delWritingTask
* @author :lyh
* @method :post
* @time :2025/10/25 15:05
*/
public function delWriting()
{
$res = $this->model->del(['id'=>['in',$this->param['id']]]);
if($res === false){
$this->fail('删除失败,请联系管理员');
}
return $this->success();
}
/**
* @remark :推送微信
* @name :sendWechatMessage
* @author :lyh
* @method :post
* @time :2025/10/28 10:15
*/
public function sendWechatMessage()
{
$this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
GeoWritings::sendConfirmMessage($this->param['project_id']);
return $this->success();
}
}