作者 lyh

gx

@@ -21,7 +21,7 @@ class BlogCategoryController extends BaseController @@ -21,7 +21,7 @@ class BlogCategoryController extends BaseController
21 //搜索条件 21 //搜索条件
22 $this->map['project_id'] = $this->user['project_id']; 22 $this->map['project_id'] = $this->user['project_id'];
23 $lists = $blogCategoryModel->lists($this->map,$this->page,$this->row,$this->order, 23 $lists = $blogCategoryModel->lists($this->map,$this->page,$this->row,$this->order,
24 - ['id','pid','name','num','status','sort','remark','created_at','updated_at']); 24 + ['id','pid','name','num','alias','status','sort','remark','created_at','updated_at']);
25 if(!empty($lists['list'])){ 25 if(!empty($lists['list'])){
26 $blogModel = new BlogModel(); 26 $blogModel = new BlogModel();
27 foreach ($lists['list'] as $k => $v){ 27 foreach ($lists['list'] as $k => $v){
@@ -21,7 +21,7 @@ class NewsCategoryController extends BaseController @@ -21,7 +21,7 @@ class NewsCategoryController extends BaseController
21 //搜索条件 21 //搜索条件
22 $this->map['project_id'] = $this->user['project_id']; 22 $this->map['project_id'] = $this->user['project_id'];
23 $lists = $newsCategory->lists($this->map,$this->page,$this->row,$this->order, 23 $lists = $newsCategory->lists($this->map,$this->page,$this->row,$this->order,
24 - ['id','pid','name','num','status','sort','remark','created_at','updated_at']); 24 + ['id','pid','name','num','alias','status','sort','remark','created_at','updated_at']);
25 if(!empty($lists['list'])){ 25 if(!empty($lists['list'])){
26 $newsModel = new NewsModel(); 26 $newsModel = new NewsModel();
27 foreach ($lists['list'] as $k => $v){ 27 foreach ($lists['list'] as $k => $v){
@@ -26,15 +26,35 @@ class AyrShareLogic extends BaseLogic @@ -26,15 +26,35 @@ class AyrShareLogic extends BaseLogic
26 $param = [ 26 $param = [
27 'title'=>md5(uniqid().time()) 27 'title'=>md5(uniqid().time())
28 ]; 28 ];
  29 + //发送请求注册社交用户
29 $ayrShareHelper = new AyrShareHelper(); 30 $ayrShareHelper = new AyrShareHelper();
30 $res = $ayrShareHelper->post_create_profiles($param); 31 $res = $ayrShareHelper->post_create_profiles($param);
31 if($res['status'] == 'fail'){ 32 if($res['status'] == 'fail'){
32 $this->response('绑定失败'); 33 $this->response('绑定失败');
33 } 34 }
  35 + //插入数据库
34 $data = [ 36 $data = [
35 'title'=>$res['title'], 37 'title'=>$res['title'],
36 - '' 38 + 'ref_id'=>$res['refId'],
  39 + 'profile_key'=>$res['profileKey'],
  40 + 'user_id'=>$this->user['id'],
  41 + 'project_id'=>$this->user['project_id'],
  42 +
37 ]; 43 ];
38 - $this->model->add($data); 44 + $rs = $this->model->add($data);
  45 + if($rs === false){
  46 + $this->fail('error');
  47 + }
  48 + return $this->success();
  49 + }
  50 +
  51 + /**
  52 + * @name :(zhuzhuang)sql_add
  53 + * @author :lyh
  54 + * @method :post
  55 + * @time :2023/5/6 10:04
  56 + */
  57 + public function sql_add(){
  58 +
39 } 59 }
40 } 60 }