作者 耿培杰

修改我的订单

... ... @@ -1395,7 +1395,7 @@ class Order extends Api
$order = $this->orderModel->getInfo(['o.id' => $param['order_id']]);
if (!$order) $this->error('订单不存在');
$order['image'] = cdnurl_arr($this->orderInfoModel->where('order_id',$param['order_id'])->column('goods_image'));
$order['goods_list'] = $this->orderInfoModel->selectData(['order_id'=>$param['order_id']],$this->lang);
if($order['present_id']){
$presentModel = new \app\api\model\Present();
$order['present'] = $presentModel->findData(['id'=>$order['present_id']],$this->lang);
... ...
... ... @@ -17,4 +17,16 @@ class OrderInfo extends Model
public function getGoodsImageAttr($value){
return cdnurl($value);
}
public function selectData($where, $lang)
{
if ($lang == 'ch') $field = 'goods_id,goods_image,goods_total,number,ch_goods_name name';
else $field = 'goods_id,goods_image,goods_total,number,en_goods_name name';
$data = $this
->where($where)
->field($field)
->select();
return $data;
}
}
... ...