发货方式优化及消息功能优化
This commit is contained in:
@@ -36,9 +36,14 @@ class Messages extends Model
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 消息类型:0=系统消息,1=公告消息,2=需求消息
|
||||
* 此处直接返回中文而非 __() 语言包:该文案会随接口返回给小程序,
|
||||
* 而 API 模块加载的语言包并不包含这些 key,__() 查不到会原样输出英文
|
||||
*/
|
||||
public function getMessageTypeList()
|
||||
{
|
||||
return ['0' => __('Message_type 0'), '1' => __('Message_type 1'), '2' => __('Message_type 2')];
|
||||
return ['0' => '系统消息', '1' => '公告消息', '2' => '需求消息'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ class Ships extends Model
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'images_list',
|
||||
'files_list'
|
||||
'files_list',
|
||||
'deliver_links_list'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -45,6 +46,14 @@ class Ships extends Model
|
||||
return self::parseUrlList($data['files'] ?? '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 交付链接列表([{url, name}]),供接口与后台直接使用
|
||||
*/
|
||||
public function getDeliverLinksListAttr($value, $data)
|
||||
{
|
||||
return self::parseUrlList($data['deliver_links'] ?? '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析多图/多文件字段:英文逗号分隔的 URL 字符串 -> [{url, name}]
|
||||
* 例:http://a.com/1.jpg,http://a.com/2.pdf => [['url'=>'http://a.com/1.jpg','name'=>'1.jpg'], ...]
|
||||
|
||||
Reference in New Issue
Block a user