123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629 |
- <?php
-
-
- namespace app\admin\model;
- use think\Model;
- use think\Page;
- use think\Config;
- use think\Db;
- use app\common\logic\ShopCommonLogic;
-
-
- class ShopOrderService extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
-
- $this->users_db = Db::name('users');
-
- $this->shop_order_db = Db::name('shop_order');
-
- $this->shop_order_details_db = Db::name('shop_order_details');
-
- $this->shop_order_service_db = Db::name('shop_order_service');
-
- $this->shop_order_service_log_db = Db::name('shop_order_service_log');
-
- $this->shop_common = new ShopCommonLogic();
- }
-
-
- public function GetAllServiceInfo($param = [], $isMerchant = false)
- {
-
- $Return = [];
- $where = [
- 'a.merchant_id' => !empty($isMerchant) ? ['>', 0] : 0
- ];
-
-
- $order_code = !empty($param['order_code']) ? trim($param['order_code']) : '';
- if (!empty($order_code)) $where['a.order_code|a.product_name|a.refund_code'] = array('LIKE', "%{$order_code}%");
-
-
- $pay_name = input('pay_name/s', '');
- $Return['pay_name'] = $pay_name;
- if (!empty($pay_name)) $where['c.pay_name'] = $pay_name;
-
-
- $order_terminal = input('order_terminal/d', 0);
- $Return['order_terminal'] = $order_terminal;
- if (!empty($order_terminal)) $where['c.order_terminal'] = $order_terminal;
-
-
- $queryStatus = input('queryStatus/d', 0);
- if (!empty($queryStatus) && 1 === intval($queryStatus)) {
- $where['a.status'] = ['IN', [1]];
- } else if (!empty($queryStatus) && 2 === intval($queryStatus)) {
- $where['a.status'] = ['IN', [2, 4, 5, 6]];
- } else if (!empty($queryStatus) && 3 === intval($queryStatus)) {
- $where['a.status'] = ['IN', [7]];
- }
-
-
-
-
-
- if (!empty($isMerchant)) {
-
- $add_time = input('add_time/s', '');
- if (!empty($add_time)) {
- $add_time = explode('~', $add_time);
- $begin = strtotime(rtrim($add_time[0]));
- $finish = strtotime(rtrim($add_time[1]));
- $where['a.add_time'] = ['between', "$begin, $finish"];
- }
- } else {
-
- $begin = strtotime(input('param.add_time_begin/s'));
- $end = input('param.add_time_end/s');
- !empty($end) && $end .= ' 23:59:59';
- $end = strtotime($end);
-
- if ($begin > 0 && $end > 0) {
- $where['a.add_time'] = array('between', "$begin, $end");
- } else if ($begin > 0) {
- $where['a.add_time'] = array('egt', $begin);
- } else if ($end > 0) {
- $where['a.add_time'] = array('elt', $end);
- }
- }
-
- $count = $this->shop_order_service_db->alias('a')->join('__SHOP_ORDER_DETAILS__ b', 'a.details_id = b.details_id', 'LEFT')->join('__SHOP_ORDER__ c', 'a.order_id = c.order_id', 'LEFT')->where($where)->count('a.service_id');
- $pageObj = new Page($count, config('paginate.list_rows'));
-
-
- if (!empty($isMerchant)) {
- $Service = $this->shop_order_service_db->alias('a')
- ->field('a.*, b.product_price, b.num, b.data as detailsData, c.order_status, c.order_amount, d.merchant_name')
- ->join('__SHOP_ORDER_DETAILS__ b', 'a.details_id = b.details_id', 'LEFT')
- ->join('__SHOP_ORDER__ c', 'a.order_id = c.order_id', 'LEFT')
- ->join('__WEAPP_MULTI_MERCHANT__ d', 'a.merchant_id = d.merchant_id', 'LEFT')
- ->limit($pageObj->firstRow.','.$pageObj->listRows)
- ->where($where)
- ->order('a.service_id desc')
- ->select();
- } else {
- $field = 'a.*, b.product_price, b.num, b.data as detailsData, c.order_status, c.order_amount';
- $weappInfo = model('ShopPublicHandle')->getWeappPointsShop();
- if (!empty($weappInfo)) $field .= ', c.points_shop_order';
- $Service = $this->shop_order_service_db->alias('a')
- ->field($field)
- ->join('__SHOP_ORDER_DETAILS__ b', 'a.details_id = b.details_id', 'LEFT')
- ->join('__SHOP_ORDER__ c', 'a.order_id = c.order_id', 'LEFT')
- ->limit($pageObj->firstRow.','.$pageObj->listRows)
- ->where($where)
- ->order('a.service_id desc')
- ->select();
- }
- $DetailsID = get_arr_column($Service, 'details_id');
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $isMobile = input('param.isMobile/d', 0);
-
- $Archives = get_archives_data($Service, 'product_id');
- foreach ($Service as $key => $value) {
- $detailsData = !empty($value['detailsData']) ? unserialize($value['detailsData']) : [];
- $Service[$key]['Details'][]['pointsGoodsBuyField'] = !empty($detailsData['pointsGoodsBuyField']) ? json_decode($detailsData['pointsGoodsBuyField'], true) : [];
-
- $Service[$key]['handle'] = in_array($value['status'], [6, 7, 8]) ? '已完成' : '处理中';
-
- $Service[$key]['add_time'] = date('Y-m-d H:i:s', $value['add_time']);
-
-
- $Service[$key]['product_img'] = handle_subdir_pic(get_default_pic($value['product_img']));
-
-
- $Service[$key]['arcurl'] = get_arcurl($Archives[$value['product_id']]);
-
-
- $value['product_spec'] = explode('<br/>', $value['product_spec']);
- $valueData = '';
- foreach ($value['product_spec'] as $key_1 => $value_1) {
- $delimiter = '';
- if (!empty($value_1)) $valueData .= '<span>' . trim(strrchr($value_1, ':'),':') . '</span>' . $delimiter;
- }
- $Service[$key]['product_spec'] = $valueData;
-
-
-
-
-
-
-
- if (1 == $value['service_type']) {
- $Service[$key]['ShippingFee'] = $Service[$key]['refund_price'] = '0.00';
- } else if (2 == $value['service_type']) {
-
- $ShippingFee = 0;
- $Service[$key]['ShippingFee'] = $ShippingFee;
-
-
-
-
-
- $ProductPrice = 0;
- if (!empty($value['product_price'])) {
- $ProductPrice = sprintf("%.2f", ($value['product_price'] * (string)$value['num']) - $ShippingFee);
- $Service[$key]['refund_price'] = $ProductPrice;
- }
- }
-
- }
-
-
- $weappInfo = model('ShopPublicHandle')->getWeappPointsShop();
- if (!empty($weappInfo)) {
- $pointsShopOrder = !empty($Service) ? get_arr_column($Service, 'points_shop_order') : [];
- if (!empty($pointsShopOrder) && in_array(1, $pointsShopOrder)) {
- $pointsShopLogic = new \weapp\PointsShop\logic\PointsShopLogic();
- $Service = $pointsShopLogic->pointsShopOrderDataHandle($Service);
- foreach ($Service as $key => $value) {
- $value['product_price'] = !empty($value['Details'][0]['product_price']) ? $value['Details'][0]['product_price'] : $value['product_price'];
- $value['refund_price'] = !empty($value['order_total_amount']) ? $value['order_total_amount'] : $value['refund_price'];
- if (1 === intval($value['service_type']) && 1 === intval($value['points_shop_order'])) {
- $value['refund_price'] = preg_replace('/\d+/', 0, $value['refund_price']);
- }
- $Service[$key] = $value;
- }
- }
- }
-
-
- $Return['Service'] = $Service;
- $Return['pageObj'] = $pageObj;
- $Return['pageStr'] = $pageObj->show();
- return $Return;
- }
-
- public function GetFieldServiceInfo($service_id = null)
- {
-
- $isMobile = input('param.isMobile/d', 0);
-
- $Return = [];
- if (empty($service_id)) return $Return;
-
-
- $Service[0] = $this->shop_order_service_db->where('service_id', $service_id)->find();
- $array_new = get_archives_data($Service, 'product_id');
- $Service = $Service[0];
-
- $Service['arcurl'] = get_arcurl($array_new[$Service['product_id']]);
- $Service['StatusName'] = Config::get('global.order_service_status')[$Service['status']];
- $Service['product_img'] = handle_subdir_pic(get_default_pic($Service['product_img']));
- $Service['TypeName'] = Config::get('global.order_service_type')[$Service['service_type']];
- $Service['product_num'] = (string)$Service['product_num'];
- $Service['add_time'] = date('Y-m-d H:i:s', $Service['add_time']);
- $Service['upload_img'] = !empty($Service['upload_img']) ? explode(',', $Service['upload_img']) : [];
-
- $Service['audit_time'] = !empty($Service['audit_time']) ? date('Y-m-d H:i:s', $Service['audit_time']) : 0;
- $Service['update_time'] = !empty($Service['update_time']) ? date('Y-m-d H:i:s', $Service['update_time']) : 0;
- $Service['manual_time'] = !empty($Service['manual_time']) ? date('Y-m-d H:i:s', $Service['manual_time']) : 0;
- if (empty($Service['manual_time']) && 1 === intval($Service['manual_refund'])) $Service['manual_time'] = $Service['update_time'];
- $Service['status_text'] = Config::get('global.order_service_status')[$Service['status']];
- $Service['service_type_text'] = Config::get('global.order_service_type')[$Service['service_type']];
- $Service['users_delivery'] = !empty($Service['users_delivery']) ? unserialize($Service['users_delivery']) : [];
- $Service['admin_delivery'] = !empty($Service['admin_delivery']) ? unserialize($Service['admin_delivery']) : [];
- if (!empty($Service['admin_delivery']['time'])) $Service['admin_delivery']['time'] = date('Y-m-d H:i:s', $Service['admin_delivery']['time']);
- $Service['actual_price'] = floatval($Service['actual_price']) > 0 ? floatval($Service['actual_price']) : floatval($Service['refund_price']);
- $Service['actual_points'] = floatval($Service['actual_points']) > 0 ? floatval($Service['actual_points']) : floatval($Service['refund_price']);
-
-
- $Service['product_spec'] = explode('<br/>', $Service['product_spec']);
- $valueData = '';
- foreach ($Service['product_spec'] as $key_1 => $value_1) {
- $delimiter = '';
- if (!empty($value_1)) $valueData .= '<span>' . trim(strrchr($value_1, ':'),':') . '</span>' . $delimiter;
- }
- $Service['product_spec'] = $valueData;
-
-
- $where = [
- 'order_id' => $Service['order_id'],
- ];
- $Order = $this->shop_order_db->where($where)->find();
- if (empty($Order['prom_type'])) {
- $Order['prom_type_name'] = '普通订单';
- } else {
- $Order['prom_type_name'] = '虚拟订单';
- }
- if (!empty($Order['is_seckill_order'])) $Order['prom_type_name'] = '秒杀订单';
- if (!empty($Order['points_shop_order'])) $Order['prom_type_name'] = '积分订单';
-
-
- $Order['order_terminal_show'] = '电脑端';
- if (!empty($Order['order_terminal']) && 2 === intval($Order['order_terminal'])) {
- $Order['order_terminal_show'] = '手机端';
- } else if (!empty($Order['order_terminal']) && 3 === intval($Order['order_terminal'])) {
- $Order['order_terminal_show'] = '微信小程序';
- }
-
- $Order['city'] = get_city_name($Order['city']);
- $Order['district'] = get_area_name($Order['district']);
- $Order['province'] = get_province_name($Order['province']);
-
- $Order['admin_note_count'] = !empty($Order['admin_note']) ? count(unserialize($Order['admin_note'])) : 0;
-
- $Order['pay_name_show'] = !empty($Order['pay_name']) ? Config::get('global.pay_method_arr')[$Order['pay_name']] : '微信支付';
-
-
- $where = [
- 'order_id' => $Service['order_id'],
- 'details_id' => $Service['details_id'],
- 'apply_service' => 1
- ];
- $Details = $this->shop_order_details_db->where($where)->find();
-
- if (empty($Details['prom_type'])) {
- $Details['prom_type_goods'] = '实物商品';
- } else if (4 == $Details['prom_type']) {
- $Details['prom_type_goods'] = '核销商品';
- } else {
- $Details['prom_type_goods'] = '虚拟商品';
- }
- $Details['product_img'] = !empty($Details['litpic']) ? get_default_pic($Details['litpic']) : '';
- $Details['product_subtotal'] = sprintf("%.2f", floatval($Details['product_price']) * floatval($Details['num']));
-
- $detailsData = !empty($Details['data']) ? unserialize($Details['data']) : [];
- $Details['pointsGoodsBuyField'] = !empty($detailsData['pointsGoodsBuyField']) ? json_decode($detailsData['pointsGoodsBuyField'], true) : [];
- $productSpec = !empty($detailsData['product_spec']) ? explode(';', $detailsData['product_spec']) : '';
- $specData = '';
- foreach ($productSpec as $value) {
- if (!empty($value)) $specData .= '<span>' . $value . '</span>';
- }
- $Details['product_spec'] = $specData;
-
-
- $where = [
- 'users_id' => intval($Service['users_id']),
- 'order_id' => intval($Service['order_id']),
- ];
- $goodsCount = $this->shop_order_details_db->where($where)->count();
-
- $where = [
- 'status' => ['IN', [6, 7]],
- 'users_id' => intval($Service['users_id']),
- 'order_id' => intval($Service['order_id']),
- ];
- $applyCount = $this->shop_order_service_db->where($where)->count();
-
- $Service['last_one'] = 1 === intval(intval($goodsCount) - intval($applyCount)) ? 1 : 0;
-
-
- if (5 == $Service['status'] || 7 == $Service['status'] || 2 == $Service['service_type']) {
-
-
-
-
- $ShippingFee = 0;
- $Service['ShippingFee'] = $ShippingFee;
-
-
-
-
-
-
- $ProductPrice = 0;
- if (!empty($Details['product_price'])) {
- $ProductPrice = sprintf("%.2f", ($Details['product_price'] * $Service['product_num']) - $ShippingFee);
- $Service['refund_price'] = $ProductPrice;
- }
- } else {
- $Service['refund_price'] = '0.00';
- }
- $Service['shipping_fee'] = $ShippingFee;
-
-
- $Users = $this->users_db->find($Service['users_id']);
- $Users['nickname'] = empty($Users['nickname']) ? $Users['username'] : $Users['nickname'];
- $Users['head_pic'] = get_head_pic($Users['head_pic'], false, $Users['sex']);
-
-
- $Order['is_change_price'] = model('ShopPublicHandle')->is_change_price($Service['order_id']);
-
-
- $Log = $this->shop_order_service_log_db->order('log_id desc')->where('service_id', $Service['service_id'])->select();
- foreach ($Log as $key => $value) {
- $value['add_time'] = date('Y-m-d H:i:s', $value['add_time']);
- if (!empty($value['users_id'])) {
- if (intval($value['users_id']) === intval($Service['users_id'])) {
- $value['name'] = '会员:'.$Users['nickname'];
- } else {
-
- $value['name'] = '商家:'.Db::name('users')->where('users_id', $value['users_id'])->getField('username');
- }
- } else if (!empty($value['admin_id'])) {
- $value['name'] = '商家:'.getAdminInfo(session('admin_id'))['user_name'];
- }
- $Log[$key] = $value;
- }
-
-
- if (!empty($Order['points_shop_order'])) {
- $weappInfo = model('ShopPublicHandle')->getWeappPointsShop();
- if (!empty($weappInfo)) {
- $list = !empty($Order) ? $Order : [];
- $list['Details'] = !empty($Details) ? [$Details] : [];
- $pointsShopLogic = new \weapp\PointsShop\logic\PointsShopLogic();
- $pointsShopLogic->pointsShopOrderDataHandle([$list], $Order, $Details);
- $Details = !empty($Order['Details'][0]) ? $Order['Details'][0] : $Details;
- $Details['product_subtotal'] = !empty($Details['subtotal']) ? $Details['subtotal'] : $Details['product_subtotal'];
- $Service['refund_price'] = !empty($Details['subtotal']) ? $Details['subtotal'] : $Service['refund_price'];
- if (1 === intval($Service['service_type']) && 1 === intval($Order['points_shop_order'])) {
- $Service['refund_price'] = preg_replace('/\d+/', 0, $Service['refund_price']);
- }
- if (isset($Details['pointsGoodsBuyField']['goodsSinglePrice']) > 0) $Service['actual_price'] = floatval($Details['pointsGoodsBuyField']['goodsSinglePrice']);
- if (isset($Details['pointsGoodsBuyField']['goodsSinglePoints']) > 0) $Service['actual_points'] = intval($Details['pointsGoodsBuyField']['goodsSinglePoints']);
- }
- }
-
- $Return['Log'] = $Log;
- $Return['Users'] = $Users;
- $Return['Order'] = $Order;
- $Return['Details'] = $Details;
- $Return['Service'] = $Service;
-
-
- $weappVerifyLog = [];
- $weappInfo = model('ShopPublicHandle')->getWeappVerifyInfo();
- if (!empty($weappInfo)) {
- $where = [
- 'users_id' => intval($Order['users_id']),
- 'order_id' => intval($Order['order_id']),
- ];
- $weappVerifyLog = Db::name('weapp_verify')->where($where)->find();
- $weappVerifyLog['verify_time'] = !empty($weappVerifyLog['verify_time']) ? date('Y-m-d H:i:s', $weappVerifyLog['verify_time']) : 0;
- }
- $Return['weappVerifyLog'] = $weappVerifyLog;
-
- return $Return;
- }
-
-
- public function GetUserAllServiceInfo($param = [])
- {
-
- $isMobile = input('param.isMobile/d', 0);
-
-
- $Return = $where =[];
- $where['a.service_type'] = 2;
- $where['a.status'] = 7;
-
-
- $order_code = !empty($param['order_code']) ? trim($param['order_code']) : '';
- if (!empty($order_code)) $where['a.order_code|a.product_name'] = array('LIKE', "%{$order_code}%");
- if (!empty($param['users_id'])) $where['a.users_id'] = $param['users_id'];
-
- $count = $this->shop_order_service_db->alias('a')->join('__SHOP_ORDER_DETAILS__ b', 'a.details_id = b.details_id', 'LEFT')->join('__SHOP_ORDER__ c', 'a.order_id = c.order_id', 'LEFT')->where($where)->count('a.service_id');
- $pageObj = new Page($count, config('paginate.list_rows'));
-
-
- $Service = $this->shop_order_service_db->alias('a')
- ->field('a.*, b.product_price, b.num')
- ->join('__SHOP_ORDER_DETAILS__ b', 'a.details_id = b.details_id', 'LEFT')
- ->join('__SHOP_ORDER__ c', 'a.order_id = c.order_id', 'LEFT')
- ->limit($pageObj->firstRow.','.$pageObj->listRows)
- ->where($where)
- ->order('a.service_id desc')
- ->select();
- $Archives = get_archives_data($Service, 'product_id');
- foreach ($Service as $key => $value) {
-
- $Service[$key]['add_time'] = date('Y-m-d H:i:s', $value['add_time']);
-
- $Service[$key]['product_img'] = handle_subdir_pic(get_default_pic($value['product_img']));
-
- $Service[$key]['arcurl'] = get_arcurl($Archives[$value['product_id']]);
-
- $value['product_spec'] = explode('<br/>', $value['product_spec']);
- $valueData = '';
- foreach ($value['product_spec'] as $key_1 => $value_1) {
- $delimiter = '';
- if (!empty($value_1)) $valueData .= '<span>' . trim(strrchr($value_1, ':'),':') . '</span>' . $delimiter;
- }
- $Service[$key]['product_spec'] = $valueData;
-
- if (1 == $value['service_type']) {
- $Service[$key]['ShippingFee'] = $Service[$key]['refund_price'] = '0.00';
- } else if (2 == $value['service_type']) {
-
- $ShippingFee = 0;
- $Service[$key]['ShippingFee'] = $ShippingFee;
-
- $ProductPrice = 0;
- if (!empty($value['product_price'])) {
- $ProductPrice = sprintf("%.2f", ($value['product_price'] * (string)$value['num']) - $ShippingFee);
- $Service[$key]['refund_price'] = $ProductPrice;
- }
- }
-
- }
-
- $Return['Service'] = $Service;
- $Return['pageObj'] = $pageObj;
- $Return['pageStr'] = $pageObj->show();
-
- return $Return;
- }
-
-
- public function afterServiceHandle($post = [])
- {
-
- $times = getTime();
- $where = [
- 'users_id' => intval($post['users_id']),
- 'order_id' => intval($post['order_id']),
- 'details_id' => intval($post['details_id']),
- 'service_id' => intval($post['service_id']),
- 'product_id' => intval($post['product_id'])
- ];
- $update = [
- 'update_time' => $times,
- 'status' => intval($post['status'])
- ];
-
- if (!empty($post['delivery'])) {
- $post['delivery']['time'] = $times;
- $update['admin_delivery'] = serialize($post['delivery']);
- }
-
- if (!empty($post['refund_remark'])) {
- $update['refund_remark'] = htmlspecialchars($post['refund_remark']);
- }
-
- if (in_array($post['status'], [2])) $update['audit_time'] = $times;
- if (in_array($post['status'], [3, 8])) $update['audit_time'] = 0;
-
- $resultID = $this->shop_order_service_db->where($where)->update($update);
-
-
- if (!empty($resultID)) {
-
- if (7 === intval($post['status']) && 1 === intval($post['refund_way']) && in_array($post['service_type'], [2, 3])) {
-
- if (!empty($post['actual_price'])) {
- $where = [
- 'users_id' => $post['users_id']
- ];
- $update = [
- 'users_money' => Db::raw('users_money+'.($post['actual_price'])),
- 'update_time' => $times
- ];
- $resultID = $this->users_db->where($where)->update($update);
- if (!empty($resultID)) {
- if (empty($post['order_code'])) {
- $post['order_code'] = $this->shop_order_db->where('order_id', $post['order_id'])->getField('order_code');
- }
-
- UsersMoneyRecording($post['order_code'], $post, $post['actual_price'], '商品退款维权结束');
- }
- }
-
- if (!empty($post['actual_points'])) {
- $insert = [
- 'type' => 12,
- 'users_id' => intval($post['users_id']),
- 'score' => intval($post['actual_points']),
- 'info' => '积分商城订单退回',
- 'remark' => '积分商城订单退回',
- ];
- addConsumObtainScores($insert);
- }
- }
-
-
- if (in_array($post['status'], [3, 8, 9])) {
- $where = [
- 'users_id' => $post['users_id'],
- 'order_id' => $post['order_id'],
- 'details_id' => $post['details_id'],
- 'product_id' => $post['product_id']
- ];
- $update = [
- 'apply_service' => 0,
- 'update_time' => $times
- ];
- $this->shop_order_details_db->where($where)->update($update);
- }
-
-
- if (in_array($post['status'], [6, 7]) && !empty($post['last_one'])) {
- $where = [
- 'users_id' => $post['users_id'],
- 'order_id' => $post['order_id'],
- ];
-
- if (in_array($post['order_status'], [1, 2])) {
- $update = [
- 'allow_service' => 1,
- 'order_status' => -1,
- 'update_time' => $times,
- ];
- $resultID = $this->shop_order_db->where($where)->update($update);
-
- if (!empty($resultID)) AddOrderAction($post['order_id'], 0, session('admin_id'), -1, 1, 1, '订单关闭', '维权完成,订单自动关闭!');
- }
-
- else if (in_array($post['order_status'], [3])) {
- $update = [
- 'allow_service' => 1,
- 'update_time' => $times,
- ];
- $this->shop_order_db->where($where)->update($update);
- }
- }
-
-
- if (in_array($post['status'], [6, 7]) && 0 === intval($post['is_refund']) && 1 === intval($post['manual_refund'])) {
- $where = [
- 'users_id' => $post['users_id'],
- 'service_id' => $post['service_id']
- ];
- $update = [
- 'manual_refund' => 1,
- 'refund_note' => trim($post['refund_note']),
- 'update_time' => getTime(),
- ];
- $this->shop_order_service_db->where($where)->update($update);
- }
-
-
- $this->shop_common->AddOrderServiceLog($post, 0);
-
- return true;
- } else {
- return false;
- }
- }
- }
|