修改财务上传凭证
This commit is contained in:
parent
0b901ef84e
commit
6fc7ba31e9
@ -15,12 +15,14 @@ namespace app\common\repositories\store\order;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\dao\store\order\StoreGroupOrderDao;
|
use app\common\dao\store\order\StoreGroupOrderDao;
|
||||||
|
use app\common\model\store\order\StoreGroupOrder;
|
||||||
use app\common\repositories\BaseRepository;
|
use app\common\repositories\BaseRepository;
|
||||||
use app\common\repositories\store\coupon\StoreCouponRepository;
|
use app\common\repositories\store\coupon\StoreCouponRepository;
|
||||||
use app\common\repositories\store\coupon\StoreCouponUserRepository;
|
use app\common\repositories\store\coupon\StoreCouponUserRepository;
|
||||||
use app\common\repositories\user\UserBillRepository;
|
use app\common\repositories\user\UserBillRepository;
|
||||||
use app\common\repositories\user\UserRepository;
|
use app\common\repositories\user\UserRepository;
|
||||||
use crmeb\jobs\CancelGroupOrderJob;
|
use crmeb\jobs\CancelGroupOrderJob;
|
||||||
|
use think\db\exception\DataNotFoundException;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\facade\Queue;
|
use think\facade\Queue;
|
||||||
@ -65,6 +67,34 @@ class StoreGroupOrderRepository extends BaseRepository
|
|||||||
return compact('count', 'list');
|
return compact('count', 'list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function detailOne($id, $flag = true)
|
||||||
|
{
|
||||||
|
|
||||||
|
$order = StoreGroupOrder::where('group_order_id', $id)
|
||||||
|
->with([
|
||||||
|
'orderList' => function (Relation $query) use ($flag) {
|
||||||
|
$query->when($flag, function ($query) {
|
||||||
|
$query->field('order_id,group_order_id,mer_id,order_sn,activity_type,pay_price,order_extend,order_type,is_virtual');
|
||||||
|
})->with([
|
||||||
|
'merchant' => function ($query) use ($flag) {
|
||||||
|
$flag && $query->field('mer_id,mer_name,service_phone')->append(['services_type']);
|
||||||
|
}, 'orderProduct', 'presellOrder'
|
||||||
|
]);
|
||||||
|
}])->find();
|
||||||
|
|
||||||
|
if ($order['paid'] == 1) {
|
||||||
|
throw new DataNotFoundException('订单不存在或已取消');
|
||||||
|
}
|
||||||
|
if (empty($order)) {
|
||||||
|
throw new DataNotFoundException('订单不存在或已取消');
|
||||||
|
}
|
||||||
|
return $order;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $uid
|
* @param $uid
|
||||||
* @param $id
|
* @param $id
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
namespace app\controller\admin\order;
|
namespace app\controller\admin\order;
|
||||||
|
|
||||||
|
use app\common\repositories\store\order\StoreGroupOrderRepository;
|
||||||
use crmeb\basic\BaseController;
|
use crmeb\basic\BaseController;
|
||||||
use app\common\repositories\store\ExcelRepository;
|
use app\common\repositories\store\ExcelRepository;
|
||||||
use app\common\repositories\system\merchant\MerchantRepository;
|
use app\common\repositories\system\merchant\MerchantRepository;
|
||||||
@ -88,8 +89,16 @@ class Order extends BaseController
|
|||||||
$data = $this->request->params(['img']);
|
$data = $this->request->params(['img']);
|
||||||
if(!$data['img'])
|
if(!$data['img'])
|
||||||
return app('json')->fail('请上传凭证');
|
return app('json')->fail('请上传凭证');
|
||||||
$this->repository->dealChangeStatus($data['img'],$id);
|
$groupOrderRepository = \app()->make(StoreGroupOrderRepository::class);
|
||||||
return app('json')->success('更新成功');
|
$groupOrder = $groupOrderRepository->detailOne((int)$id, false);
|
||||||
|
$groupOrder->order_extend=$data['img'];
|
||||||
|
// $this->repository->dealChangeStatus($data['img'],$id);
|
||||||
|
$res=$this->repository->financialVoucher($groupOrder);
|
||||||
|
if($res){
|
||||||
|
return app('json')->success('更新成功');
|
||||||
|
}else{
|
||||||
|
return app('json')->fail('操作失败');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user