修复了在设置成功时返回错误信息的问题,并优化了商品单位获取方式。

This commit is contained in:
mkm 2024-05-29 11:51:22 +08:00
parent d8a78633ea
commit 400d8c1f93
3 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class CashierclassController extends BaseAdminController
if ($id) { if ($id) {
$res = Cashierclass::where('id', $id)->update(['is_print' => 1]); $res = Cashierclass::where('id', $id)->update(['is_print' => 1]);
if ($res) { if ($res) {
return $this->success('设置成功', [], 1, 1); return $this->success('设置成功');
} }
} }
return $this->success('设置失败'); return $this->success('设置失败');

View File

@ -54,8 +54,8 @@ class CashierinfoLists extends BaseAdminDataLists implements ListsSearchInterfac
$cashier = Cashierclass::field('number')->where('id',$data['pid'])->findOrEmpty(); $cashier = Cashierclass::field('number')->where('id',$data['pid'])->findOrEmpty();
$room = Db::name('room')->where('id',$data['room'])->find(); $room = Db::name('room')->where('id',$data['room'])->find();
$warehouse = Warehouse::field('name')->where('id',$data['warehouse'])->findOrEmpty(); $warehouse = Warehouse::field('name')->where('id',$data['warehouse'])->findOrEmpty();
$unit=Db::name('unit')->where('id',$data['unit'])->value('name'); $goods = Goods::field('name,imgs,unit')->where('id',$data['goods'])->findOrEmpty();
$goods = Goods::field('name,imgs')->where('id',$data['goods'])->findOrEmpty(); $unit=Db::name('unit')->where('id',$goods['unit'])->value('name');
$data['cashier_number'] = !$cashier->isEmpty() ? $cashier['number'] : ''; $data['cashier_number'] = !$cashier->isEmpty() ? $cashier['number'] : '';
$data['room_data'] = !empty($room) ? $room : []; $data['room_data'] = !empty($room) ? $room : [];
$data['warehouse_name'] = !$warehouse->isEmpty() ? $warehouse['name'] : ''; $data['warehouse_name'] = !$warehouse->isEmpty() ? $warehouse['name'] : '';

View File

@ -46,7 +46,7 @@ class OpurchaseclassController extends BaseApiController
$data = [ $data = [
'delivery_name' => $delivery_name, 'delivery_name' => $delivery_name,
'delivery_id' => $delivery_id, 'delivery_id' => $delivery_id,
'supplier_id'=>$delivery_id, 'supplier_id'=>$supplier_id,
]; ];
$res = OpurchaseGoodsOfferLogic::express($data); $res = OpurchaseGoodsOfferLogic::express($data);
if (true === $res) { if (true === $res) {