订单核销修改

This commit is contained in:
liuchaofu 2024-06-04 22:20:47 +08:00
parent b6e6b97a50
commit b61a99b060
4 changed files with 8 additions and 17 deletions

View File

@ -359,7 +359,7 @@ class OrderController extends BaseApiController
if ($res) { if ($res) {
return $this->success('核销成功'); return $this->success('核销成功');
} }
return $this->fail('核销失败'); return $this->fail('核销失败'.OrderLogic::getError());
} }

View File

@ -49,7 +49,7 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()
->each(function($item){ ->each(function($item){
$item['goods_list']=StoreOrderCartInfo::where('oid',$item['id'])->with('goodsName')->field('product_id,cart_num')->limit(3)->select(); $item['goods_list']=StoreOrderCartInfo::where('oid',$item['id'])->with('goodsName')->field('product_id,cart_num,verify_code,is_writeoff,writeoff_time')->limit(3)->select();
$item['goods_count']=count(explode(',',$item['cart_id'])); $item['goods_count']=count(explode(',',$item['cart_id']));
}) })
->toArray(); ->toArray();

View File

@ -8,7 +8,6 @@ use app\common\enum\YesNoEnum;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\logic\CapitalFlowLogic; use app\common\logic\CapitalFlowLogic;
use app\common\logic\StoreFinanceFlowLogic; use app\common\logic\StoreFinanceFlowLogic;
use app\common\model\merchant\Merchant;
use app\common\model\order\Cart; use app\common\model\order\Cart;
use app\common\model\store_branch_product\StoreBranchProduct; use app\common\model\store_branch_product\StoreBranchProduct;
use app\common\model\store_order\StoreOrder; use app\common\model\store_order\StoreOrder;
@ -19,7 +18,6 @@ use app\common\model\store_product_unit\StoreProductUnit;
use app\common\model\system_store\SystemStore; use app\common\model\system_store\SystemStore;
use app\common\model\user\User; use app\common\model\user\User;
use app\common\model\user\UserAddress; use app\common\model\user\UserAddress;
use app\Request;
use support\Log; use support\Log;
use taoser\exception\ValidateException; use taoser\exception\ValidateException;
use think\Exception; use think\Exception;
@ -101,10 +99,6 @@ class OrderLogic extends BaseLogic
if (!$orderInfo) { if (!$orderInfo) {
return false; return false;
} }
// `delivery_name`快递名称/送货人姓名',
// `delivery_code`'快递公司编码',
// `delivery_type` '发货类型',
// `delivery_id'快递单号/手机号',
$_order = $orderInfo['order']; $_order = $orderInfo['order'];
$_order['deduction_price'] = 0; $_order['deduction_price'] = 0;
$_order['uid'] = request()->userId; $_order['uid'] = request()->userId;
@ -113,7 +107,10 @@ class OrderLogic extends BaseLogic
$_order['mobile'] = $user['mobile']; $_order['mobile'] = $user['mobile'];
$_order['pay_type'] = $orderInfo['order']['pay_type']; $_order['pay_type'] = $orderInfo['order']['pay_type'];
$_order['verify_code'] = $verify_code; $_order['verify_code'] = $verify_code;
if (isset($params['reservation_time'])) {
$_order['reservation_time'] = $params['reservation_time'];
$_order['reservation'] = YesNoEnum::YES;
}
if ($addressId > 0) { if ($addressId > 0) {
$address = UserAddress::where(['id' => $addressId, 'uid' => Request()->userId])->find(); $address = UserAddress::where(['id' => $addressId, 'uid' => Request()->userId])->find();
if ($address) { if ($address) {
@ -122,12 +119,6 @@ class OrderLogic extends BaseLogic
$_order['user_address'] = $address['detail']; $_order['user_address'] = $address['detail'];
} }
} }
// if($params['pay_type']==PayEnum::WECHAT_PAY_BARCODE){
// $_order['source']=1;
// }
// if($params['pay_type']==PayEnum::CASH_PAY){
// $_order['money']=$_order['total'];
// }
Db::startTrans(); Db::startTrans();
try { try {

View File

@ -12,7 +12,7 @@ class CapitalFlowLogic extends BaseLogic
public function __construct($obj, $type = 'user') public function __construct($obj, $type = 'user')
{ {
if (isset($type)) { if (isset($type) && $type == 'user') {
$this->user = $obj; $this->user = $obj;
} else { } else {
$this->store = $obj; $this->store = $obj;
@ -85,7 +85,7 @@ class CapitalFlowLogic extends BaseLogic
public function storeIncome($category, $linkType, $linkId, $amount, $mark = '') public function storeIncome($category, $linkType, $linkId, $amount, $mark = '')
{ {
$model = new CapitalFlow(); $model = new CapitalFlow();
$model->store_id = $this->store['store_id']; $model->store_id = $this->store['id'];
$model->category = $category; $model->category = $category;
$model->link_type = $linkType; $model->link_type = $linkType;
$model->link_id = $linkId; $model->link_id = $linkId;