This commit is contained in:
mkm 2024-05-06 14:16:23 +08:00
parent 61c88e968c
commit 1fa0d3d5e5
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ namespace app\admin\logic\retail;
use app\common\model\retail\Cashierclass;
use app\common\logic\BaseLogic;
use app\common\model\goods\Unit;
use app\common\model\retail\Cashierinfo;
use think\facade\Db;
@ -116,7 +117,10 @@ class CashierclassLogic extends BaseLogic
if($find){
$find['goods_list']= Cashierinfo::where('pid',$params['id'])
->with('goodsName')
->field('goods,price sell,nums')->select();
->field('goods,price sell,nums')->select()->each(function($item){
$item['msg']='预计48小时发货';
$item['goods_unit']=Unit::where('id',$item['unit'])->value('name');
});
}
return $find->toArray();
}

View File

@ -21,6 +21,6 @@ class Cashierinfo extends BaseModel
public function goodsName()
{
return $this->hasOne(Goods::class,'id','goods')->bind(['class_name'=>'name','imgs']);
return $this->hasOne(Goods::class,'id','goods')->bind(['class_name'=>'name','imgs','unit']);
}
}