<?php
|
|
namespace app\common\model\commission;
|
|
use think\Model;
|
|
|
class Jtk extends Model
|
{
|
|
// 表名
|
protected $name = 'jtk_union_order_commission';
|
|
// 自动写入时间戳字段
|
protected $autoWriteTimestamp = false;
|
|
// 定义时间戳字段名
|
protected $createTime = false;
|
protected $updateTime = false;
|
|
const TK_STATUS = ['1'=>'已付款','2'=>'已收货','3'=>'已结算','4'=>'已失效'];
|
|
//追加属性
|
protected $append = [
|
'create_time_text',
|
'tk_status_text'
|
];
|
|
public function getCreateTimeTextAttr($vaule,$data)
|
{
|
return (empty($data['create_time']) || $data['create_time'] == 0) ? "" : date("Y-m-d H:i:s",$data['create_time']);
|
}
|
|
public function getTkStatusTextAttr($vaule,$data)
|
{
|
return (empty($data['tk_status']) || !isset(self::TK_STATUS[$data['tk_status']])) ? "未知" : self::TK_STATUS[$data['tk_status']];
|
}
|
|
|
/**
|
* Undocumented function
|
*
|
* @return void
|
*/
|
public function getItemImgAttr()
|
{
|
return "https://hxshapp.oss-cn-beijing.aliyuncs.com/app/img/20210702/1111111111115.png";
|
}
|
|
}
|