作者 李宇航

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

Master server



查看合并请求 !1207
@@ -64,7 +64,7 @@ class AiBlogController extends BaseController @@ -64,7 +64,7 @@ class AiBlogController extends BaseController
64 if(!empty($lists) && !empty($lists['list'])){ 64 if(!empty($lists) && !empty($lists['list'])){
65 foreach ($lists['list'] as $k => $v){ 65 foreach ($lists['list'] as $k => $v){
66 $v['image'] = getImageUrl($v['image']); 66 $v['image'] = getImageUrl($v['image']);
67 - $v['route'] = $this->user['domain'] . '/ai_blog/' . $v['route']; 67 + $v['route'] = $this->user['domain'] . '/' . $v['route'];
68 $lists['list'][$k] = $v; 68 $lists['list'][$k] = $v;
69 } 69 }
70 } 70 }
@@ -101,6 +101,13 @@ class AiBlogController extends BaseController @@ -101,6 +101,13 @@ class AiBlogController extends BaseController
101 public function getAiBlogAuthor(AiBlogAuthor $aiBlogAuthor){ 101 public function getAiBlogAuthor(AiBlogAuthor $aiBlogAuthor){
102 $field = ['id','route','author_id','title','image','created_at','updated_at']; 102 $field = ['id','route','author_id','title','image','created_at','updated_at'];
103 $lists = $aiBlogAuthor->lists($this->map,$this->page,$this->row,'id',$field); 103 $lists = $aiBlogAuthor->lists($this->map,$this->page,$this->row,'id',$field);
  104 + if(!empty($lists) && !empty($lists['list'])){
  105 + foreach ($lists['list'] as $k => $v){
  106 + $v['image'] = getImageUrl($v['image']);
  107 + $v['route'] = $this->user['domain'] . '/' . $v['route'];
  108 + $lists['list'][$k] = $v;
  109 + }
  110 + }
104 $this->response('success',Code::SUCCESS,$lists); 111 $this->response('success',Code::SUCCESS,$lists);
105 } 112 }
106 113
@@ -162,6 +169,12 @@ class AiBlogController extends BaseController @@ -162,6 +169,12 @@ class AiBlogController extends BaseController
162 */ 169 */
163 public function getAiBlogList(AiBlogList $aiBlogList){ 170 public function getAiBlogList(AiBlogList $aiBlogList){
164 $lists = $aiBlogList->lists($this->map,$this->page,$this->row,'id',['id','route','created_at','updated_at']); 171 $lists = $aiBlogList->lists($this->map,$this->page,$this->row,'id',['id','route','created_at','updated_at']);
  172 + if(!empty($lists) && !empty($lists['list'])){
  173 + foreach ($lists['list'] as $k => $v){
  174 + $v['route'] = $this->user['domain'] . '/ai_blogs/' . $v['route'];
  175 + $lists['list'][$k] = $v;
  176 + }
  177 + }
165 $this->response('success',Code::SUCCESS,$lists); 178 $this->response('success',Code::SUCCESS,$lists);
166 } 179 }
167 180
@@ -248,7 +248,7 @@ class ProjectLogic extends BaseLogic @@ -248,7 +248,7 @@ class ProjectLogic extends BaseLogic
248 public function createAuthor($project_id,$mch_id,$key){ 248 public function createAuthor($project_id,$mch_id,$key){
249 //查看当前项目是否已经创建了作者 249 //查看当前项目是否已经创建了作者
250 $aiBlogTaskModel = new AiBlogTask(); 250 $aiBlogTaskModel = new AiBlogTask();
251 - $count = $aiBlogTaskModel->count(); 251 + $count = $aiBlogTaskModel->counts(['project_id'=>$project_id]);
252 if($count > 0){ 252 if($count > 0){
253 return true; 253 return true;
254 } 254 }