Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
8fe86d5bd9
@ -57,6 +57,11 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI
|
|||||||
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(empty($where) && $class_all){
|
||||||
|
//2或者1
|
||||||
|
$where[]=['cate_id','=',$class_all];
|
||||||
|
}
|
||||||
|
|
||||||
return StoreBranchProduct::where($this->searchWhere)->where($where)
|
return StoreBranchProduct::where($this->searchWhere)->where($where)
|
||||||
->field(['id','store_id','product_id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'unit', 'cost','purchase', 'status'])
|
->field(['id','store_id','product_id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'unit', 'cost','purchase', 'status'])
|
||||||
->when(!empty($this->adminInfo['store_id']), function ($query) {
|
->when(!empty($this->adminInfo['store_id']), function ($query) {
|
||||||
|
@ -33,6 +33,7 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
return [
|
return [
|
||||||
'=' => ['store_id', 'user_id', 'create_time', 'staff_id'],
|
'=' => ['store_id', 'user_id', 'create_time', 'staff_id'],
|
||||||
'between_time'=>'create_time',
|
'between_time'=>'create_time',
|
||||||
|
'%pipe_like%' => ['keyword'=>'order_sn'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,8 @@ class StoreProductLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
|
|
||||||
StoreProduct::where('id', $params['id'])->update($data);
|
StoreProduct::where('id', $params['id'])->update($data);
|
||||||
$old_cate = StoreBranchProduct::where('product_id', $params['id'])->field('cate_id,store_id')
|
|
||||||
|
/*$old_cate = StoreBranchProduct::where('product_id', $params['id'])->field('cate_id,store_id')
|
||||||
->select();
|
->select();
|
||||||
// 获取分类ID
|
// 获取分类ID
|
||||||
foreach ($old_cate as $vv) {
|
foreach ($old_cate as $vv) {
|
||||||
@ -169,13 +170,13 @@ class StoreProductLogic extends BaseLogic
|
|||||||
//新增对应的分类
|
//新增对应的分类
|
||||||
self::updateGoodsclass($params['cate_id'], $value['store_id']);
|
self::updateGoodsclass($params['cate_id'], $value['store_id']);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
StoreBranchProduct::where('product_id', $params['id'])->update([
|
StoreBranchProduct::where('product_id', $params['id'])->update([
|
||||||
'price' => $params['price'], 'vip_price' => $params['vip_price'],
|
'price' => $params['price'], 'vip_price' => $params['vip_price'],
|
||||||
'cost' => $params['cost'], 'cate_id' => $params['cate_id'],
|
'cost' => $params['cost'],
|
||||||
'batch'=>$params['batch'],'store_name'=>$params['store_name']
|
'batch'=>$params['batch'],'store_name'=>$params['store_name']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -84,12 +84,13 @@ class OrderLogic extends BaseLogic
|
|||||||
$cart_select[$k]['cost'] = $find['cost'];
|
$cart_select[$k]['cost'] = $find['cost'];
|
||||||
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
|
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
|
||||||
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
|
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
|
||||||
|
$cart_select[$k]['vip'] = 0;
|
||||||
if ($user && $user['user_ship'] == 1) {
|
if ($user && $user['user_ship'] == 1) {
|
||||||
//更新 会员为1的时候原价减去会员价
|
//更新 会员为1的时候原价减去会员价
|
||||||
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
|
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
|
||||||
$cart_select[$k]['deduction_price'] =$deduction_price_count;
|
$cart_select[$k]['deduction_price'] =$deduction_price_count;
|
||||||
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
|
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
|
||||||
|
$cart_select[$k]['vip'] =1;
|
||||||
}
|
}
|
||||||
if ($user && $user['user_ship'] == 4) {
|
if ($user && $user['user_ship'] == 4) {
|
||||||
//更新 为4商户的时候减去商户价格
|
//更新 为4商户的时候减去商户价格
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\common\logic;
|
namespace app\common\logic;
|
||||||
|
|
||||||
|
use app\api\logic\order\OrderLogic;
|
||||||
use app\common\enum\OrderEnum;
|
use app\common\enum\OrderEnum;
|
||||||
use app\common\enum\PayEnum;
|
use app\common\enum\PayEnum;
|
||||||
use app\common\enum\user\UserShipEnum;
|
use app\common\enum\user\UserShipEnum;
|
||||||
@ -124,6 +125,15 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($extra && $extra['store_id']){
|
||||||
|
$params = [
|
||||||
|
'verify_code'=>$order['verify_code'],
|
||||||
|
'store_id'=>$extra['store_id'],
|
||||||
|
'staff_id'=>$extra['staff_id']
|
||||||
|
];
|
||||||
|
OrderLogic::writeOff($params);
|
||||||
|
}
|
||||||
|
|
||||||
// self::afterPay($order);
|
// self::afterPay($order);
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||||
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
@ -252,10 +262,10 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$order->paid = 1;
|
$order->paid = 1;
|
||||||
$order->pay_time = time();
|
$order->pay_time = time();
|
||||||
$order->status = 2;
|
$order->status = 2;
|
||||||
self::afterPay($order);
|
|
||||||
if (!$order->save()) {
|
if (!$order->save()) {
|
||||||
throw new \Exception('订单保存出错');
|
throw new \Exception('订单保存出错');
|
||||||
}
|
}
|
||||||
|
self::afterPay($order);
|
||||||
$cashFlowLogic = new CashFlowLogic();
|
$cashFlowLogic = new CashFlowLogic();
|
||||||
$cashFlowLogic->insert($order['store_id'], $order['pay_price']);
|
$cashFlowLogic->insert($order['store_id'], $order['pay_price']);
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']]);
|
// Redis::send('push-platform-print', ['id' => $order['id']]);
|
||||||
|
@ -61,12 +61,13 @@ class StoreOrderLogic extends BaseLogic
|
|||||||
$cart_select[$k]['cost'] = $find['cost'];
|
$cart_select[$k]['cost'] = $find['cost'];
|
||||||
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
|
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
|
||||||
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
|
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
|
||||||
|
$cart_select[$k]['vip'] = 0;
|
||||||
if ($user && $user['user_ship'] == 1) {
|
if ($user && $user['user_ship'] == 1) {
|
||||||
//更新 会员为1的时候原价减去会员价
|
//更新 会员为1的时候原价减去会员价
|
||||||
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
|
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
|
||||||
$cart_select[$k]['deduction_price'] =$deduction_price_count;
|
$cart_select[$k]['deduction_price'] =$deduction_price_count;
|
||||||
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
|
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
|
||||||
|
$cart_select[$k]['vip'] =1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user && $user['user_ship'] == 4) {
|
if ($user && $user['user_ship'] == 4) {
|
||||||
@ -223,6 +224,12 @@ class StoreOrderLogic extends BaseLogic
|
|||||||
$order['refund_type_name'] = OrderEnum::refundType($order['refund_type']) ?? '';
|
$order['refund_type_name'] = OrderEnum::refundType($order['refund_type']) ?? '';
|
||||||
$order['pay_type_name'] =PayEnum::getPaySceneDesc($order['pay_type']) ?? '';
|
$order['pay_type_name'] =PayEnum::getPaySceneDesc($order['pay_type']) ?? '';
|
||||||
|
|
||||||
|
$detail =StoreOrderCartInfo::where('oid',$order['id'])->find()->toArray();
|
||||||
|
$vip =0;
|
||||||
|
if(isset($detail['cart_info']['vip']) && $detail['cart_info']['vip'] == 1){
|
||||||
|
$vip = 1;
|
||||||
|
}
|
||||||
|
$order['vip'] = $vip;
|
||||||
return $order->toArray();
|
return $order->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
namespace app\store\controller\finance;
|
namespace app\store\controller\finance;
|
||||||
|
|
||||||
|
use app\admin\lists\store_finance_flow\StoreFinanceFlowDayLists;
|
||||||
use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
|
use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
|
||||||
|
use app\admin\lists\store_finance_flow\StoreFinanceFlowMonthLists;
|
||||||
|
use app\admin\lists\store_finance_flow\StoreFinanceFlowWeekLists;
|
||||||
use app\common\controller\Definitions;
|
use app\common\controller\Definitions;
|
||||||
use app\common\lists\StoreBillLists;
|
use app\common\lists\StoreBillLists;
|
||||||
use app\store\controller\BaseAdminController;
|
use app\store\controller\BaseAdminController;
|
||||||
@ -27,7 +30,15 @@ class StoreBillController extends BaseAdminController
|
|||||||
// ]
|
// ]
|
||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
return $this->dataLists(new StoreBillLists());
|
$type = $this->request->get('type');
|
||||||
|
if($type == 1){
|
||||||
|
return $this->dataLists(new StoreFinanceFlowDayLists());
|
||||||
|
}else if($type == 2){
|
||||||
|
return $this->dataLists(new StoreFinanceFlowWeekLists());
|
||||||
|
}else{
|
||||||
|
return $this->dataLists(new StoreFinanceFlowMonthLists());
|
||||||
|
}
|
||||||
|
// return $this->dataLists(new StoreBillLists());
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[
|
// #[
|
||||||
|
@ -146,7 +146,10 @@ class StoreOrderController extends BaseAdminController
|
|||||||
switch ($pay_type) {
|
switch ($pay_type) {
|
||||||
case PayEnum::PURCHASE_FUNDS:
|
case PayEnum::PURCHASE_FUNDS:
|
||||||
//采购款支付
|
//采购款支付
|
||||||
PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $uid]);
|
PayNotifyLogic::handle('purchase_funds', $order['order_id'], [
|
||||||
|
'uid' => $uid,'store_id'=>$this->request->adminInfo['store_id'],
|
||||||
|
'staff_id'=>$this->request->adminInfo['admin_id']
|
||||||
|
]);
|
||||||
return $this->success('采购款支付成功', ['id' => $order['id']]);
|
return $this->success('采购款支付成功', ['id' => $order['id']]);
|
||||||
|
|
||||||
case PayEnum::CASH_PAY:
|
case PayEnum::CASH_PAY:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user