作者 lyh

gx

... ... @@ -33,14 +33,13 @@ class CustomModuleContentController extends BaseController
]);
$this->map['project_id'] = $this->user['project_id'];
$lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($lists, true) . PHP_EOL, FILE_APPEND);
if(!empty($lists)){
$data = $this->getAllCategoryName();
foreach ($lists as $k=>$v){
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($v, true) . PHP_EOL, FILE_APPEND);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($v['category_id'], true) . PHP_EOL, FILE_APPEND);
// $v['category_name'] = $this->categoryName($v['category_id'],$data);
$v['image_link'] = getImageUrl($v['image']);
$v['operator_name'] = (new User())->getName($v['operator_id']);
$v['category_name'] = $this->categoryName($v->category_id,$data);
$v['image_link'] = getImageUrl($v->image);
$v['operator_name'] = (new User())->getName($v->operator_id);
$lists[$k] = $v;
}
}
... ...
... ... @@ -18,7 +18,7 @@ class CustomModuleContent extends Base
//连接数据库
protected $connection = 'custom_mysql';
// public function getCategoryIdAttribute($value){
// return explode(',',trim($value,','));
// }
public function getCategoryIdAttribute($value){
return explode(',',trim($value,','));
}
}
... ...