OrderInfo.php
780 字节
<?php
namespace app\api\model;
use think\Model;
class OrderInfo extends Model
{
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
public function getGoodsImageAttr($value){
return cdnurl($value);
}
public function selectData($where, $lang)
{
if ($lang == 'ch') $field = 'id order_info_id,status,goods_id,goods_image,goods_total,number,ch_goods_name name';
else $field = 'id order_info_id,status,goods_id,goods_image,goods_total,number,en_goods_name name';
$data = $this
->where($where)
->field($field)
->select();
return $data;
}
}