财务审核+返购物车商户类型
This commit is contained in:
parent
718505a62b
commit
85a6b5a8f6
@ -34,6 +34,11 @@ class Enum
|
|||||||
const STATUS_REFUNDED = -1;//已退款
|
const STATUS_REFUNDED = -1;//已退款
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户端判断里海云仓库或者综合云市场
|
||||||
|
*/
|
||||||
|
const Lihai_Store = [11,22];
|
||||||
|
|
||||||
/** @const MAP */
|
/** @const MAP */
|
||||||
const MAP = [
|
const MAP = [
|
||||||
self::SALE_TYPE_RETAIL => '零售',
|
self::SALE_TYPE_RETAIL => '零售',
|
||||||
|
@ -15,6 +15,7 @@ namespace app\common\repositories\store\order;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\dao\store\order\StoreCartDao;
|
use app\common\dao\store\order\StoreCartDao;
|
||||||
|
use app\common\Enum;
|
||||||
use app\common\model\store\product\Product;
|
use app\common\model\store\product\Product;
|
||||||
use app\common\repositories\BaseRepository;
|
use app\common\repositories\BaseRepository;
|
||||||
use app\common\repositories\store\coupon\StoreCouponProductRepository;
|
use app\common\repositories\store\coupon\StoreCouponProductRepository;
|
||||||
@ -62,11 +63,12 @@ class StoreCartRepository extends BaseRepository
|
|||||||
$arr = $fail = [];
|
$arr = $fail = [];
|
||||||
$product_make = app()->make(ProductRepository::class);
|
$product_make = app()->make(ProductRepository::class);
|
||||||
$svip_status = ($user && $user->is_svip > 0 && systemConfig('svip_switch_status')) ? true : false;
|
$svip_status = ($user && $user->is_svip > 0 && systemConfig('svip_switch_status')) ? true : false;
|
||||||
foreach ($res as $item) {
|
foreach ($res as $item) { //halt($item->toArray());
|
||||||
if (!$item['checkCartProduct']) {
|
if (!$item['checkCartProduct']) {//失效
|
||||||
$item['product'] = $product_make->getFailProduct($item['product_id']);
|
$item['product'] = $product_make->getFailProduct($item['product_id']);
|
||||||
$fail[] = $item;
|
$fail[] = $item;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//商户信息
|
//商户信息
|
||||||
if ($item['merchant']){
|
if ($item['merchant']){
|
||||||
$merchantData = $item['merchant']->append(['openReceipt'])->toArray();
|
$merchantData = $item['merchant']->append(['openReceipt'])->toArray();
|
||||||
@ -80,6 +82,15 @@ class StoreCartRepository extends BaseRepository
|
|||||||
$merchantData['hasCoupon'] = $coupon_make->validMerCouponExists($item['mer_id'], $hasCoupon);
|
$merchantData['hasCoupon'] = $coupon_make->validMerCouponExists($item['mer_id'], $hasCoupon);
|
||||||
$arr[$item['mer_id']] = $merchantData;
|
$arr[$item['mer_id']] = $merchantData;
|
||||||
}
|
}
|
||||||
|
if($merchantData['mer_id'] != 0){
|
||||||
|
if(in_array($merchantData['type_id'] ,Enum::Lihai_Store)){
|
||||||
|
$arr[$item['mer_id']]['cloud_warehouse']="里海云仓";
|
||||||
|
}else{
|
||||||
|
$arr[$item['mer_id']]['cloud_warehouse'] ="综合云市场";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($hasCoupon && !$arr[$item['mer_id']]['hasCoupon']) {
|
if ($hasCoupon && !$arr[$item['mer_id']]['hasCoupon']) {
|
||||||
$couponIds = app()->make(StoreCouponProductRepository::class)->productByCouponId([$item['product']['product_id']]);
|
$couponIds = app()->make(StoreCouponProductRepository::class)->productByCouponId([$item['product']['product_id']]);
|
||||||
$arr[$item['mer_id']]['hasCoupon'] = count($couponIds) ? $coupon_make->validProductCouponExists([$item['product']['product_id']], $hasCoupon) : 0;
|
$arr[$item['mer_id']]['hasCoupon'] = count($couponIds) ? $coupon_make->validProductCouponExists([$item['product']['product_id']], $hasCoupon) : 0;
|
||||||
@ -94,6 +105,7 @@ class StoreCartRepository extends BaseRepository
|
|||||||
$arr[$item['mer_id']]['list'][] = $item;
|
$arr[$item['mer_id']]['list'][] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = array_values($arr);
|
$list = array_values($arr);
|
||||||
return compact('list', 'fail');
|
return compact('list', 'fail');
|
||||||
}
|
}
|
||||||
|
@ -2782,5 +2782,25 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dealChangeStatus($img,$status,$id)
|
||||||
|
{
|
||||||
|
$data = StoreOrder::getDB()->where('order_id',$id)->find();
|
||||||
|
if(empty($data)) return app('json')->fail('没有该订单');
|
||||||
|
$data->financial_voucher = $img;
|
||||||
|
|
||||||
|
if($status){
|
||||||
|
$data->paid = 1;//支付
|
||||||
|
$data->pay_time = date('Y-m-d H:i:s',time());
|
||||||
|
StoreGroupOrder::getDB()->where('group_order_id',$data['group_order_id'])
|
||||||
|
->update(['paid'=>1,'pay_time'=>date('Y-m-d H:i:s',time())]);
|
||||||
|
}
|
||||||
|
$data->save();
|
||||||
|
return app('json')->success('更新成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,17 @@ class Order extends BaseController
|
|||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function changeStatus($id)
|
||||||
|
{
|
||||||
|
//图片和状态
|
||||||
|
$data = $this->request->param(['img','status']);
|
||||||
|
$this->repository->dealChangeStatus($data['img'],$data['status'],$id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function takeTitle()
|
public function takeTitle()
|
||||||
{
|
{
|
||||||
$where = $this->request->params(['date', 'order_sn', 'keywords', 'username', 'is_trader']);
|
$where = $this->request->params(['date', 'order_sn', 'keywords', 'username', 'is_trader']);
|
||||||
|
@ -50,6 +50,10 @@ Route::group(function () {
|
|||||||
Route::get('lst', 'Order/getAllList')->name('systemOrderLst')->option([
|
Route::get('lst', 'Order/getAllList')->name('systemOrderLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Route::get('change/:id', 'Order/changeStatus')->name('systemOrderChange')->option([
|
||||||
|
'_alias' => '财务凭证',
|
||||||
|
]);
|
||||||
Route::get('title', 'Order/title')->name('systemOrderStat')->option([
|
Route::get('title', 'Order/title')->name('systemOrderStat')->option([
|
||||||
'_alias' => '金额统计',
|
'_alias' => '金额统计',
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user