commit
178a4b5223
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\api\logic\DemoLogic;
|
||||
use app\common\service\pay\PayService;
|
||||
|
||||
class IndexController extends BaseAdminController
|
||||
@ -24,4 +25,9 @@ class IndexController extends BaseAdminController
|
||||
return $this->fail($e->extra['message']);
|
||||
}
|
||||
}
|
||||
public function demo2()
|
||||
{
|
||||
$res=DemoLogic::test();
|
||||
return $this->success('成功',$res);
|
||||
}
|
||||
}
|
@ -71,6 +71,12 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc
|
||||
->select()->each(function($item) use($job_ids){
|
||||
$item->order_sn=BeforehandOrder::where('id',$item['order_id'])->value('order_id');
|
||||
$find=StoreProduct::where('id',$item->product_id)->withTrashed()->find();
|
||||
$item->store_info = empty($item['store_info']) ? ($find['store_info'] ?? '') : $item['store_info'];
|
||||
$item->after_sales = empty($item['after_sales']) ? ($find['after_sales'] ?? '') : $item['after_sales'];
|
||||
$item->marques = empty($item['marques']) ? ($find['marques'] ?? '') : $item['marques'];
|
||||
$item->package = empty($item['package']) ? ($find['package'] ?? '') : $item['package'];
|
||||
$item->expiration_date = $item->expiration_date ? date('Y-m-d', $item->expiration_date) : '';
|
||||
$item->manufacture = $item->manufacture ? date('Y-m-d', $item->manufacture) : '';
|
||||
$item->store_name=$find->store_name;
|
||||
$item->image=$find->image;
|
||||
$item->unit_name=StoreProductUnit::where('id',$item->unit)->value('name');
|
||||
|
@ -235,6 +235,8 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
|
||||
$data['purchase'] = $v['price'];
|
||||
$data['total_price'] = $v['total_price'];
|
||||
$data['financial_pm'] = 1;
|
||||
$data['manufacture'] = $v['manufacture'] > 0 ? date('Y-m-d H:i:s', $v['manufacture']) : '';
|
||||
$data['expiration_date'] = $v['expiration_date'] > 0 ? date('Y-m-d H:i:s', $v['expiration_date']) : '';
|
||||
$product_arr=[];
|
||||
if($v['package']!=''){
|
||||
$product_arr['package']=$v['package'];
|
||||
|
@ -156,6 +156,8 @@ class PurchaseProductOfferLogic extends BaseLogic
|
||||
*/
|
||||
public static function setProcureInfo(array $params): bool
|
||||
{
|
||||
$params['manufacture'] = !empty($params['manufacture']) ? strtotime($params['manufacture']) : '';
|
||||
$params['expiration_date'] = !empty($params['expiration_date']) ? strtotime($params['expiration_date']) : '';
|
||||
$offer = PurchaseProductOffer::where(['id' => $params['id']])->find();
|
||||
// $uid=Admin::where('id',$params['admin_id'])->value('uid');
|
||||
// if($params['admin_id']!=1){
|
||||
@ -177,6 +179,8 @@ class PurchaseProductOfferLogic extends BaseLogic
|
||||
'store_info' => $params['store_info'],
|
||||
'marques' => $params['marques'],
|
||||
'after_sales' => $params['after_sales'],
|
||||
'manufacture' => $params['manufacture'],
|
||||
'expiration_date' => $params['expiration_date'],
|
||||
]);
|
||||
// $find = StoreProductPrice::where(['offer_id' => $params['id']])->find();
|
||||
$product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id')->find();
|
||||
|
@ -74,7 +74,6 @@ class StoreProductLogic extends BaseLogic
|
||||
'product_type' => $params['product_type'] ?? 0,
|
||||
'is_show' => $params['is_show'] ?? 0,
|
||||
'made_place' => $params['made_place'] ?? '',
|
||||
'shelf_life' => $params['shelf_life'] ?? 0,
|
||||
];
|
||||
$rose = 0;
|
||||
//零售-供货
|
||||
@ -225,7 +224,6 @@ class StoreProductLogic extends BaseLogic
|
||||
'swap' => $params['swap'] ?? 0,
|
||||
'is_show' => $params['is_show'] ?? 0,
|
||||
'made_place' => $params['made_place'] ?? '',
|
||||
'shelf_life' => $params['shelf_life'] ?? 0,
|
||||
];
|
||||
$rose = 0;
|
||||
//零售-供货
|
||||
|
@ -193,7 +193,6 @@ class WarehouseProductLogic extends BaseLogic
|
||||
*/
|
||||
public static function edit(array $params)
|
||||
{
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$before_nums = 0;
|
||||
@ -221,24 +220,24 @@ class WarehouseProductLogic extends BaseLogic
|
||||
$before_nums = $warehouseProductStorege['nums'];
|
||||
$after_nums = bcsub($warehouseProductStorege['nums'], $params['nums'], 2);
|
||||
}
|
||||
$datas = [
|
||||
'nums' => $params['nums'],
|
||||
'before_nums' => $before_nums,
|
||||
'after_nums' => $after_nums,
|
||||
'total_price' => $params['total_price'],
|
||||
];
|
||||
if($find['financial_pm']==1){
|
||||
$datas=[
|
||||
'nums' => $params['nums'],
|
||||
'supplier_id' => $params['supplier_id'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'purchase' => $params['purchase'],
|
||||
'before_nums' => $before_nums,
|
||||
'after_nums' => $after_nums,
|
||||
'total_price' => $params['total_price'],
|
||||
];
|
||||
$datas['supplier_id'] = $params['supplier_id'];
|
||||
$datas['pay_type'] = $params['pay_type'];
|
||||
$datas['purchase'] = $params['purchase'];
|
||||
}else{
|
||||
$datas=[
|
||||
'nums' => $params['nums'],
|
||||
'price' => $params['price'],
|
||||
'before_nums' => $before_nums,
|
||||
'after_nums' => $after_nums,
|
||||
'total_price' => $params['total_price'],
|
||||
];
|
||||
$datas['price'] = $params['price'];
|
||||
}
|
||||
if (isset($params['manufacture']) && $params['manufacture'] != '') {
|
||||
$datas['manufacture'] = strtotime($params['manufacture']);
|
||||
}
|
||||
if (isset($params['expiration_date']) && $params['expiration_date'] != '') {
|
||||
$datas['expiration_date'] = strtotime($params['expiration_date']);
|
||||
}
|
||||
WarehouseProduct::where('id', $params['id'])->update($datas);
|
||||
$finds = WarehouseProduct::where('oid', $params['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
|
||||
|
Loading…
x
Reference in New Issue
Block a user