作者 Your Name

Merge branch 'dev' of http://47.244.231.31:8099/zhl/globalso-v6 into dev

@@ -9,7 +9,7 @@ use GuzzleHttp\Client; @@ -9,7 +9,7 @@ use GuzzleHttp\Client;
9 */ 9 */
10 class AyrShare 10 class AyrShare
11 { 11 {
12 - public $path = 'https://app.ayrshare.com/api'; 12 + public $path = 'https://app.ayrshare.com';
13 //api_key 13 //api_key
14 public $api_key = 'G8GQW3X-XBTMGXW-QPDDZ9A-WE1Z5SB'; 14 public $api_key = 'G8GQW3X-XBTMGXW-QPDDZ9A-WE1Z5SB';
15 //系统设置 15 //系统设置
@@ -228,9 +228,9 @@ class AyrShare @@ -228,9 +228,9 @@ class AyrShare
228 $client = new Client(); 228 $client = new Client();
229 try { 229 try {
230 $res = $client->request(strtoupper($method), $url, $post_data)->getBody()->getContents(); 230 $res = $client->request(strtoupper($method), $url, $post_data)->getBody()->getContents();
231 - return $res; 231 + return (array)json_decode($res);
232 } catch (\Exception $e) { 232 } catch (\Exception $e) {
233 - return json_encode(["status"=>"fail","message"=>$e->getMessage()]); 233 + return ["status"=>"fail","message"=>$e->getMessage()];
234 } 234 }
235 } 235 }
236 } 236 }
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside\AyrShare; @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside\AyrShare;
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
6 use App\Helper\AyrShare as AyrShareHelper; 6 use App\Helper\AyrShare as AyrShareHelper;
7 use App\Http\Controllers\Bside\BaseController; 7 use App\Http\Controllers\Bside\BaseController;
  8 +use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
8 use App\Models\AyrShare\AyrShare as AyrShareModel; 9 use App\Models\AyrShare\AyrShare as AyrShareModel;
9 10
10 /** 11 /**
@@ -29,16 +30,8 @@ class AyrShareController extends BaseController @@ -29,16 +30,8 @@ class AyrShareController extends BaseController
29 * @method :post 30 * @method :post
30 * @time :2023/5/5 16:44 31 * @time :2023/5/5 16:44
31 */ 32 */
32 - public function create_account(){  
33 - $data = [  
34 - 'title'=>md5(uniqid().time())  
35 - ];  
36 - $ayrShareHelper = new AyrShareHelper();  
37 - $res = $ayrShareHelper->post_create_profiles($data);  
38 - var_dump($res);  
39 - die();  
40 - if($res === false){  
41 -  
42 - } 33 + public function create_account(AyrShareLogic $ayrShareLogic){
  34 + $ayrShareLogic->ayr_share_add();
  35 + $this->response('success');
43 } 36 }
44 } 37 }
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 namespace App\Http\Logic\Bside\AyrShare; 3 namespace App\Http\Logic\Bside\AyrShare;
4 4
  5 +use App\Helper\AyrShare as AyrShareHelper;
5 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
6 use App\Models\AyrShare\AyrShare; 7 use App\Models\AyrShare\AyrShare;
7 8
@@ -15,4 +16,25 @@ class AyrShareLogic extends BaseLogic @@ -15,4 +16,25 @@ class AyrShareLogic extends BaseLogic
15 $this->param = $this->requestAll; 16 $this->param = $this->requestAll;
16 } 17 }
17 18
  19 + /**
  20 + * @name :(创建账号并绑定)ayr_add
  21 + * @author :lyh
  22 + * @method :post
  23 + * @time :2023/5/6 9:19
  24 + */
  25 + public function ayr_share_add(){
  26 + $param = [
  27 + 'title'=>md5(uniqid().time())
  28 + ];
  29 + $ayrShareHelper = new AyrShareHelper();
  30 + $res = $ayrShareHelper->post_create_profiles($param);
  31 + if($res['status'] == 'fail'){
  32 + $this->response('绑定失败');
  33 + }
  34 + $data = [
  35 + 'title'=>$res['title'],
  36 + ''
  37 + ];
  38 + $this->model->add($data);
  39 + }
18 } 40 }
@@ -173,7 +173,7 @@ class BlogLogic extends BaseLogic @@ -173,7 +173,7 @@ class BlogLogic extends BaseLogic
173 */ 173 */
174 public function blog_status(){ 174 public function blog_status(){
175 $this->param['operator_id'] = $this->user['id']; 175 $this->param['operator_id'] = $this->user['id'];
176 - $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 176 + $rs = $this->model->edit($this->param,['id'=>['in',$this->param['id']]]);
177 if($rs === false){ 177 if($rs === false){
178 $this->fail('error'); 178 $this->fail('error');
179 } 179 }
@@ -134,7 +134,7 @@ class NewsLogic extends BaseLogic @@ -134,7 +134,7 @@ class NewsLogic extends BaseLogic
134 */ 134 */
135 public function news_status(){ 135 public function news_status(){
136 $this->param['operator_id'] = $this->user['id']; 136 $this->param['operator_id'] = $this->user['id'];
137 - $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 137 + $rs = $this->model->edit($this->param,['id'=>['in',$this->param['id']]]);
138 if($rs === false){ 138 if($rs === false){
139 $this->fail('error'); 139 $this->fail('error');
140 } 140 }
  1 +<?php
  2 +
  3 +namespace App\Http\Requests\Bside\AyrShare;
  4 +
  5 +use Illuminate\Foundation\Http\FormRequest;
  6 +
  7 +class AyrShareRequest extends FormRequest
  8 +{
  9 + /**
  10 + * Determine if the user is authorized to make this request.
  11 + *
  12 + * @return bool
  13 + */
  14 + public function authorize()
  15 + {
  16 + return true;
  17 + }
  18 +
  19 +}