Commit a322fafb by 朱继来

调整DB

parent 8834f8e9
......@@ -8,6 +8,10 @@ use Illuminate\Foundation\Inspiring;
use DB;
use Log;
use Illuminate\Support\Facades\Redis;
use App\Model\RegionModel;
use App\Model\OrderModel;
use App\Model\OrderAddressModel;
class JingDiaoOrderAddress extends Command
{
/**
......@@ -38,7 +42,7 @@ class JingDiaoOrderAddress extends Command
protected function getregion($parent_id = 0){
$str = "";
if($parent_id != 1){
$region = DB::Connection("order")->table("lie_region")->where(["region_id"=>$parent_id])->first();
$region = RegionModel::where(["region_id"=>$parent_id])->first();
$str = $region->region_name." ".$str;
if($region && $region->parent_id != 1){
$str = $this->getregion($region->parent_id)." ".$str;
......@@ -80,7 +84,7 @@ class JingDiaoOrderAddress extends Command
// }
//return;
DB::Connection("order")->table("lie_order")->where(["is_type"=>1])->orderBy("order_id","desc")->chunk(100,function($orders){
OrderModel::where(["is_type"=>1])->orderBy("order_id","desc")->chunk(100,function($orders){
foreach($orders as $order){
try{
......@@ -103,7 +107,7 @@ class JingDiaoOrderAddress extends Command
$str = mb_substr($orderRemark,0,2);
$region = DB::Connection("order")->table("lie_region")->whereRaw("region_name like '{$str}%'")->first();
$region = RegionModel::whereRaw("region_name like '{$str}%'")->first();
if(!$region){
......@@ -140,7 +144,7 @@ class JingDiaoOrderAddress extends Command
//生成随机地址
protected function getRandomAddress(){
$random = rand(1,367456);
$address = DB::Connection("order")->table("lie_order_address")->where(["order_address_id"=>$random])->first();
$address = OrderAddressModel::where(["order_address_id"=>$random])->first();
if($address){
return $address;
}else{
......
......@@ -124,27 +124,27 @@ class JingDiaoUser extends Command
*/
public function handle(){
$userids = $this->userids();
$users = DB::Connection("order")->table("lie_user_main")->whereIn("user_id",$userids)->where("is_type","=",1)->pluck("user_id");
$users = DB::Connection("web")->table("lie_user_main")->whereIn("user_id",$userids)->where("is_type","=",1)->pluck("user_id");
try{
DB::Connection("order")->beginTransaction();
DB::Connection("web")->beginTransaction();
foreach($users as $user_id){
DB::Connection("order")->table("lie_user_main")->where(["user_id"=>$user_id])->update([
DB::Connection("web")->table("lie_user_main")->where(["user_id"=>$user_id])->update([
"is_type"=>0,
]);
continue;
$zjf_z = DB::Connection("order")->table("lie_point_log")->where("user_id",$user_id)->where("flow_type",1)->sum("flow_point");
$zjf_f = DB::Connection("order")->table("lie_point_log")->where("user_id",$user_id)->where("flow_type",2)->sum("flow_point");
$zjf_z = DB::Connection("web")->table("lie_point_log")->where("user_id",$user_id)->where("flow_type",1)->sum("flow_point");
$zjf_f = DB::Connection("web")->table("lie_point_log")->where("user_id",$user_id)->where("flow_type",2)->sum("flow_point");
$jifen = intval($zjf_z - $zjf_f);
dump(sprintf("userid:%s 的积分为:%s",$user_id,$jifen));
$userInfo = DB::Connection("order")->table("lie_user_info")->where(["user_id"=>$user_id])->select("cur_user_point","cur_total_point")->first();
$userInfo = DB::Connection("web")->table("lie_user_info")->where(["user_id"=>$user_id])->select("cur_user_point","cur_total_point")->first();
$bk = DB::Connection("order")->table("lie_user_info")->where(["user_id"=>$user_id])->update([
$bk = DB::Connection("web")->table("lie_user_info")->where(["user_id"=>$user_id])->update([
"cur_user_point"=>$jifen,
"cur_total_point"=>$jifen,
]);
......@@ -153,10 +153,10 @@ class JingDiaoUser extends Command
}
DB::Connection("order")->commit();
DB::Connection("web")->commit();
}catch(\Exception $e){
dump($e->getMessage());
DB::Connection("order")->rollBack();
DB::Connection("web")->rollBack();
}
}
......@@ -169,11 +169,11 @@ class JingDiaoUser extends Command
{
$userids = $this->userids();
$users = DB::Connection("order")->table("lie_user_main")->whereIn("user_id",$userids)->where("is_type","=",1)->pluck("user_id");
$users = DB::Connection("web")->table("lie_user_main")->whereIn("user_id",$userids)->where("is_type","=",1)->pluck("user_id");
try{
DB::Connection("order")->beginTransaction();
DB::Connection("web")->beginTransaction();
......@@ -187,7 +187,7 @@ class JingDiaoUser extends Command
->select("order_amount","order_goods_type","is_type","order_pay_type","integral","status","order_id","create_time")->get();
// dump($orders);
$zong_jifen = 0;
$userMobile = DB::Connection("order")->table("lie_user_main")->where("user_id",$user_id)->select("mobile")->first();
$userMobile = DB::Connection("web")->table("lie_user_main")->where("user_id",$user_id)->select("mobile")->first();
foreach($orders as $k=>$order){
$jifen = 0;
if($order->order_pay_type == 3){
......@@ -220,7 +220,7 @@ class JingDiaoUser extends Command
];
// dump($jifenData);
$bk = DB::Connection("order")->table("lie_point_log")->insert($jifenData);
$bk = DB::Connection("web")->table("lie_point_log")->insert($jifenData);
if(!$bk){
throw new \Exception("添加数据失败");
}
......@@ -228,16 +228,16 @@ class JingDiaoUser extends Command
$zong_jifen += $jifen;
}
$zong_jifen = intval($zong_jifen);
$userInfo = DB::Connection("order")->table("lie_user_info")->where(["user_id"=>$user_id])->select("cur_user_point","cur_total_point")->first();
$userInfo = DB::Connection("web")->table("lie_user_info")->where(["user_id"=>$user_id])->select("cur_user_point","cur_total_point")->first();
if(!$userInfo){
$userInfo = DB::Connection("order")->table("lie_user_info")->insert([
$userInfo = DB::Connection("web")->table("lie_user_info")->insert([
"user_id"=>$user_id,
"cur_user_point"=>$zong_jifen,
"cur_total_point"=>$zong_jifen,
]);
}
DB::Connection("order")->table("lie_user_info")->where(["user_id"=>$user_id])->update([
DB::Connection("web")->table("lie_user_info")->where(["user_id"=>$user_id])->update([
"cur_user_point"=>$userInfo->cur_user_point,
"cur_total_point"=>$userInfo->cur_total_point,
]);
......@@ -249,11 +249,11 @@ class JingDiaoUser extends Command
}
DB::Connection("order")->commit();
DB::Connection("web")->commit();
}catch(\Exception $e){
dump($e->getMessage());
DB::Connection("order")->rollBack();
DB::Connection("web")->rollBack();
}
......@@ -360,7 +360,7 @@ class JingDiaoUser extends Command
}
$count = DB::connection('order')
$count = DB::connection('web')
->table('lie_user_main')
......@@ -384,13 +384,13 @@ class JingDiaoUser extends Command
$countN=0;
$userJD = [];
DB::Connection("order")->table("lie_user_main")->select("user_id","mobile","is_type")->OrderBy("user_id","desc")->whereRaw(" is_type = 1 and mobile != '' ")
DB::Connection("web")->table("lie_user_main")->select("user_id","mobile","is_type")->OrderBy("user_id","desc")->whereRaw(" is_type = 1 and mobile != '' ")
->chunk(100, function($users) use(&$countN,&$userJD) {
foreach ($users as $user) {
$user_id = $user->user_id;
$logs = null;
$orders = null;
$logs = DB::Connection("order")->table("lie_user_login")->where(["user_id"=>$user_id])->count("id");
$logs = DB::Connection("web")->table("lie_user_login")->where(["user_id"=>$user_id])->count("id");
$orders = DB::Connection("order")->table("lie_order")->where(["user_id"=>$user_id,"is_type"=>0])->count("order_id");
if(!$logs && !$orders){
dump($user->user_id);
......@@ -417,7 +417,7 @@ class JingDiaoUser extends Command
$redis->hset("api_email",$email,$user->user_id);
DB::Connection("order")->table("lie_user_main")->where(["user_id"=>$user->user_id])->update([
DB::Connection("web")->table("lie_user_main")->where(["user_id"=>$user->user_id])->update([
"mobile"=>"",
"email"=>$email
]);
......
......@@ -11,7 +11,17 @@ use App\Http\Page;
use App\Http\Controllers\PermController;
use App\Http\Error;
use App\Model\UserMainModel;
use App\Model\UserAddressModel;
use App\Model\TaxInfoModel;
use App\Model\InvoiceCompanyModel;
use App\Model\RegionModel;
use App\Model\ShoppingCartModel;
use App\Model\OrderModel;
use App\Model\OrderExtendModel;
use App\Model\OrderPriceModel;
use App\Model\ShoppingCartModel;
use App\Model\PayLogModel;
use App\Model\OrderActionLogModel;
use App\Model\CrmModel;
use App\Model\CmsModel;
use Excel;
......@@ -206,7 +216,7 @@ Class AddOrderController extends Controller
}
}
$address = DB::connection('order')->table('lie_user_address')->where('user_id', $user->user_id)->select('address_id', 'consignee')->get(); // 收货地址
$address = UserAddressModel::where('user_id', $user->user_id)->select('address_id', 'consignee')->get(); // 收货地址
// $invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user->user_id)->select('tax_id', 'tax_title')->get(); // 发票信息
$info['user'] = $user;
......@@ -237,7 +247,7 @@ Class AddOrderController extends Controller
if ($request->isMethod('post')) {
$address_id = $request->input('address_id');
$address = DB::connection('order')->table('lie_user_address')->where('address_id', $address_id)->first();
$address = UserAddressModel::where('address_id', $address_id)->first();
$address->province_val = $this->getAddress($address->province);
$address->city_val = $this->getAddress($address->city);
......@@ -253,7 +263,7 @@ Class AddOrderController extends Controller
if ($request->isMethod('post')) {
$tax_id = $request->input('tax_id');
$invoice = DB::connection('order')->table('lie_taxinfo')->where('tax_id', $tax_id)->first();
$invoice = TaxInfoModel::where('tax_id', $tax_id)->first();
$invoice->province_val = $invoice->consignee_province ? $this->getAddress($invoice->consignee_province) : '';
$invoice->city_val = $invoice->consignee_city ? $this->getAddress($invoice->consignee_city) : '';
......@@ -261,7 +271,7 @@ Class AddOrderController extends Controller
// 发票公司信息
if (in_array($invoice->inv_type, [3, 4])) {
$company_info = DB::connection('order')->table('lie_invoice_company')->where('com_name', $invoice->tax_title)->first();
$company_info = InvoiceCompanyModel::where('com_name', $invoice->tax_title)->first();
if ($company_info) {
$invoice->customer_en = $company_info->customer_en;
......@@ -283,7 +293,7 @@ Class AddOrderController extends Controller
$user_id = $request->input('user_id');
$inv_type = $request->input('inv_type');
$invoice = DB::connection('order')->table('lie_taxinfo')->where(['user_id'=>$user_id, 'inv_type'=>$inv_type])->select('tax_id', 'tax_title')->get();
$invoice = TaxInfoModel::where(['user_id'=>$user_id, 'inv_type'=>$inv_type])->select('tax_id', 'tax_title')->get();
return ['errcode' => 0, 'errmsg' => '', 'data' => $invoice];
}
......@@ -315,7 +325,7 @@ Class AddOrderController extends Controller
// 查询省市区
public function getAddress($id)
{
$addr = DB::connection('order')->table('lie_region')->where('region_id', $id)->select('region_name')->first();
$addr = RegionModel::where('region_id', $id)->select('region_name')->first();
return $addr ? $addr->region_name : '未匹配到ID:'.$id;
}
......@@ -328,11 +338,11 @@ Class AddOrderController extends Controller
$info['title'] = '新增自营线下订单';
// 默认内部账号ID
$internal = DB::connection('order')->table('lie_user_main')->where('mobile', Config('website.internal-account'))->select('user_id')->first();
$internal = UserMainModel::where('mobile', Config('website.internal-account'))->select('user_id')->first();
$info['internal_uid'] = $internal->user_id;
// 默认内部账号收货地址
$address = DB::connection('order')->table('lie_user_address')->where(['user_id' => $info['internal_uid'], 'is_default' => 1])->first();
$address = UserAddressModel::where(['user_id' => $info['internal_uid'], 'is_default' => 1])->first();
$address->province_val = $this->getAddress($address->province);
$address->city_val = $this->getAddress($address->city);
......@@ -350,7 +360,7 @@ Class AddOrderController extends Controller
$intracode = DB::table('lie_intracode')->where('admin_id', $sale_id)->select('user_id')->first();
if (!empty($intracode)) {
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $intracode->user_id)->select('mobile')->first();
$user = UserMainModel::where('user_id', $intracode->user_id)->select('mobile')->first();
$info['mobile'] = $user ? $user->mobile : '';
} else {
......@@ -551,7 +561,7 @@ Class AddOrderController extends Controller
$data['buyer_id'] = $CmsModel->getSaleId($buyer);
}
} else { // 修改交期
$goods_data = DB::connection('order')->table('lie_shopping_cart')->where('cart_id', $cart_id)->value('goods_data');
$goods_data = ShoppingCartModel::where('cart_id', $cart_id)->value('goods_data');
if (!$goods_data) {
$goods_data['delivery_time'] = $delivery_time;
......@@ -563,7 +573,7 @@ Class AddOrderController extends Controller
$data['goods_data'] = json_encode($goods_data);
}
$res = DB::connection('order')->table('lie_shopping_cart')->where('cart_id', $cart_id)->update($data);
$res = ShoppingCartModel::where('cart_id', $cart_id)->update($data);
if ($res === false) return ['errcode' => -1, 'errmsg' => '修改失败'];
......@@ -773,10 +783,10 @@ Class AddOrderController extends Controller
$info['type'] = $type;
$info['is_quiry'] = $request->input('is_quiry', '');
$order = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->first();
$order = OrderModel::where('order_id', $order_id)->first();
if ($type != 3) {
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $order->user_id)->select('mobile')->first();
$user = UserMainModel::where('user_id', $order->user_id)->select('mobile')->first();
$info['user_info'] = $user;
}
......@@ -803,7 +813,7 @@ Class AddOrderController extends Controller
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
$orderInfo = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->first();
$orderInfo = OrderModel::where('order_id', $order_id)->first();
DB::beginTransaction();
try {
......@@ -814,7 +824,7 @@ Class AddOrderController extends Controller
$price['price'] = '-'.$orderInfo->order_amount;
$price['create_time'] = time();
$priceAdd = DB::connection('order')->table('lie_order_price')->insert($price);
$priceAdd = OrderPriceModel::insert($price);
// 添加付款记录
$pay['user_id'] = $orderInfo->user_id;
......@@ -828,10 +838,10 @@ Class AddOrderController extends Controller
$pay['create_time'] = time();
$pay['pay_time'] = time();
$payLog = DB::connection('order')->table('lie_pay_log')->insert($pay);
$payLog = PayLogModel::insert($pay);
// 待发货状态
$update = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update(['status' => $status, 'pay_time' => time(), 'wms_syn' => 1]);
$update = OrderModel::where('order_id', $order_id)->update(['status' => $status, 'pay_time' => time(), 'wms_syn' => 1]);
if ($update && $priceAdd && $payLog) {
DB::commit();
......@@ -868,7 +878,8 @@ Class AddOrderController extends Controller
$log['event'] = $event;
$log['ip'] = get_client_ip();
$log['create_time'] = time();
$actionLog = DB::connection('order')->table('lie_order_action_log')->insert($log);
$actionLog = OrderActionLogModel::insert($log);
if (!$actionLog){
errorLog(Error::E_ADD_FAILED, '添加操作记录失败');
......@@ -1093,7 +1104,7 @@ Class AddOrderController extends Controller
$data['operator_id'] = $request->user->userId;
if ($goods_type == 1 && !$add_type) {
$temp_save_info = DB::connection('order')->table('lie_order_extend')->where('order_id', $data['order_id'])->value('temp_save_info');
$temp_save_info = OrderExtendModel::where('order_id', $data['order_id'])->value('temp_save_info');
// 获取临时保存信息
if ($temp_save_info) {
......
......@@ -5,7 +5,8 @@ use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Error;
use DB;
use App\Http\Model\UserActionLogModel;
use App\Model\RegionModel;
use App\Model\UserAddressModel;
class AddressController extends Controller
{
......@@ -58,7 +59,7 @@ class AddressController extends Controller
// 地址
public function getRegion($region_id)
{
$region = DB::connection('order')->table('lie_region')->where('region_id', $region_id)->select('region_name')->first();
$region = RegionModel::where('region_id', $region_id)->select('region_name')->first();
return $region ? $region->region_name : '';
}
......@@ -69,7 +70,7 @@ class AddressController extends Controller
if ($request->isMethod('post')) {
$address_id = $request->input('address_id');
$info = DB::connection('order')->table('lie_user_address')->where('address_id', $address_id)->first();
$info = UserAddressModel::where('address_id', $address_id)->first();
if (empty($info)) return ['errcode' => Error::E_NOT_EXISTS, 'errmsg' => '未找到'];
......@@ -160,15 +161,13 @@ class AddressController extends Controller
}
if ($map['user_id'] && isset($map['address_type'])) {
$addressList = DB::connection('order')->table('lie_user_address')->where($map)->get();
$addressList = UserAddressModel::where($map)->get();
}
if(!empty($addressList) && is_array($addressList)) {
$region = array();
foreach ($addressList as &$val) {
$region = DB::connection('order')
->table('lie_region')
->whereIn('region_id', [$val->province, $val->city, $val->district])
$region = RegionModel::whereIn('region_id', [$val->province, $val->city, $val->district])
->select('region_id', 'region_name')
->get();
......
......@@ -18,20 +18,23 @@ use App\Model\OrderExtendModel;
use App\Model\OrderItemsModel;
use App\Model\OrderItemsTrackModel;
use App\Model\OrderItemsTrackingModel;
use App\Model\UserSampleApplyModel;
use App\Model\OrderActionLogModel;
use App\Model\UserSampleInviteModel;
use App\Model\UserGroupModel;
use App\Model\UserMainModel;
use App\Model\BrandBlackListModel;
use App\Model\PayExtendModel;
use Illuminate\Support\Facades\Redis;
use App\Model\ShoppingCartModel;
use App\Model\OrderServiceModel;
use App\Model\OrderServiceItemsModel;
use App\Model\OrderServiceLogModel;
use App\Model\OrderRefundModel;
use App\Model\OrderRefundLogModel;
use App\Model\BrandBlackListModel;
use App\Model\PayExtendModel;
use App\Model\UserMainModel;
use App\Model\UserAddressModel;
use App\Model\TaxInfoModel;
use App\Model\RegionModel;
use App\Model\UserGroupModel;
use App\Model\UserSampleApplyModel;
use App\Model\UserSampleInviteModel;
use Illuminate\Support\Facades\Redis;
use DB;
use App\Model\Frq\InquiryItemsReportModel;
......@@ -524,7 +527,7 @@ class ApiController extends Controller
if ($account) {
$field = preg_match('/@/', $account) ? 'email' : 'mobile';
$user_id = DB::connection('order')->table('lie_user_main')->where($field, $account)->value('user_id');
$user_id = UserMainModel::where($field, $account)->value('user_id');
}
// 公司和联系方式都存在
......@@ -599,7 +602,7 @@ class ApiController extends Controller
$where['user_id'] = $user_id;
$where['inv_type'] = 2;
$tax_info = DB::connection('order')->table('lie_taxinfo')->where($where)->select('tax_title', 'tax_id')->get();
$tax_info = TaxInfoModel::where($where)->select('tax_title', 'tax_id')->get();
$this->Export(0, '', $tax_info);
}
......@@ -613,7 +616,7 @@ class ApiController extends Controller
$map['tax_title'] = $com_info->com_name;
$map['user_id'] = $user_id;
$map['inv_type'] = $invoice_type;
$invoice = DB::connection('order')->table('lie_taxinfo')->where($map)->first();
$invoice = TaxInfoModel::where($map)->first();
if (!$invoice) $this->Export(-1, '未找到发票信息');
$tax_info['tax_id'] = isset($invoice) ? $invoice->tax_id : 0;
......@@ -644,7 +647,7 @@ class ApiController extends Controller
$map['user_id'] = $user_id;
$map['address_type'] = 0;
$address = DB::connection('order')->table('lie_user_address')->where($map)->get();
$address = UserAddressModel::where($map)->get();
if (empty($address)) $this->Export(-1, '未获取到用户收货地址');
foreach ($address as &$v) {
......@@ -661,7 +664,7 @@ class ApiController extends Controller
// 查询省市区
public function getAddress($id)
{
return DB::connection('order')->table('lie_region')->where('region_id', $id)->value('region_name');
return RegionModel::where('region_id', $id)->value('region_name');
}
// 导入销售报价物料
......
......@@ -12,20 +12,29 @@ use App\Http\Controllers\PermController;
use Illuminate\Support\Facades\Redis;
use App\Http\Error;
use Excel;
use App\Model\UserMainModel;
use App\Model\UserCompanyModel;
use App\Model\CmsModel;
use App\Model\QueuedModel;
use App\Model\OrderModel;
use App\Model\OrderExtendModel;
use App\Model\UserMainModel;
use App\Model\OrderPriceModel;
use App\Model\OrderAddressModel;
use App\Model\OrderActionLogModel;
use App\Model\OrderReturnModel;
use App\Model\OrderItemsTrackModel;
use App\Model\OrderItemsTrackingModel;
use App\Model\CmsModel;
use App\Model\QueuedModel;
use App\Model\PayLogModel;
use App\Model\ErpPayLogModel;
use App\Model\PayExtendModel;
use App\Model\OrderPurPriceModel;
use App\Model\OrderShippingModel;
use App\Model\OrderInvoiceModel;
use App\Model\OrderServiceModel;
use App\Model\OrderServiceItemsModel;
use App\Model\RemovalItemsModel;
use App\Model\OrderReturnItemsModel;
use App\Model\ShippingModel;
use App\Model\CrmModel;
use Session;
use Hprose\Http\Client;
......@@ -33,14 +42,7 @@ use Hprose\Http\Client;
// 获取订单优惠券金额
function getCoupon($order_id)
{
$price = DB::connection('order')
->table('lie_order_price')
->where(['order_id' => $order_id, 'price_type' => -4])
->first();
if (!$price) return null;
return $price->price;
return OrderPriceModel::where(['order_id' => $order_id, 'price_type' => -4])->value('price');
}
// 获取会员账号
......@@ -48,8 +50,7 @@ function getAccountName($user_id)
{
if (!$user_id) return false;
$userMainModel = new UserMainModel();
$user = $userMainModel->where('user_id', $user_id)->select('mobile', 'email')->first();
$user = UserMainModel::where('user_id', $user_id)->select('mobile', 'email')->first();
if (!$user) return false;
......@@ -59,13 +60,9 @@ function getAccountName($user_id)
// 获取支付名称
function getPayName($order_id)
{
$payLog = DB::connection('order')
->table('lie_pay_log')
->where(['order_id' => $order_id])
->select('pay_name')
->get();
$payLog = PayLogModel::where(['order_id' => $order_id])->select('pay_name')->get();
if (!$payLog) return false;
if ($payLog->isEmpty()) return false;
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
......@@ -76,9 +73,7 @@ function getPayName($order_id)
function getShipping($order_id, $shipping_type=1)
{
$shipping = DB::connection('order')
->table('lie_order_shipping')
->where(['order_id' => $order_id, 'shipping_type' => $shipping_type])
$shipping = OrderShippingModel::where(['order_id' => $order_id, 'shipping_type' => $shipping_type])
->select('shipping_no', 'status')
->orderBy('order_shipping_id')
->get();
......@@ -90,15 +85,7 @@ function getShipping($order_id, $shipping_type=1)
function getInvoiceStatus($order_id)
{
$invoice = DB::connection('order')
->table('lie_order_invoice')
->where(['order_id' => $order_id])
->select('invoice_status')
->first();
if (!$invoice) return false;
return $invoice->invoice_status;
return OrderInvoiceModel::where(['order_id' => $order_id])->value('invoice_status');
}
// 发票抬头 -> 合同公司
......@@ -106,7 +93,7 @@ function getCompanyName($order_id, $user_id)
{
if (!$user_id) return false;
$tax_title = DB::connection('order')->table('lie_order_invoice')->where('order_id', $order_id)->where('inv_type', '<>', 1)->value('tax_title');
$tax_title = OrderInvoiceModel::where('order_id', $order_id)->where('inv_type', '<>', 1)->value('tax_title');
if ($tax_title) return $tax_title;
// $contract_com_name = DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->value('contract_com_name');
......@@ -114,7 +101,7 @@ function getCompanyName($order_id, $user_id)
// return false;
$com_name = DB::connection('order')->table('lie_user_company')->where('user_id', $user_id)->value('com_name');
$com_name = UserCompanyModel::where('user_id', $user_id)->value('com_name');
if ($com_name) return $com_name;
return false;
......@@ -160,7 +147,7 @@ function isNewClient($order_goods_type, $user_id, $create_time)
// $order = DB::connection('order')->table('lie_order')->where('order_goods_type', $order_goods_type)->where('user_id', $user_id)->whereBetween('create_time', [$half_year_time, $create_time-1])->get();
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $user_id)->first();
$user = UserMainModel::where('user_id', $user_id)->first();
// return empty($order) && empty($user->client_source) ? true : false;
return $user && $user->is_new == 0 && empty($user->client_source) ? true : false;
......@@ -171,9 +158,7 @@ function clientSource($user_id)
{
if (!$user_id) return false;
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $user_id)->select('client_source')->first();
return $user ? $user->client_source : '';
return UserMainModel::where('user_id', $user_id)->value('client_source');
}
// 获取自营商品型号
......@@ -188,7 +173,7 @@ function getGoodsName($goods_id)
function getOrderSource($order_id, $order_type=1, $order_goods_type=1)
{
if ($order_type == 1) {
$order_source = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->value('order_source');
$order_source = OrderModel::where('order_id', $order_id)->value('order_source');
if (preg_match('/pf=1/', $order_source)) {
$source = 'PC端';
......@@ -246,11 +231,7 @@ function handleOrderSource($order_source)
// 获取订单收货人
function getOrderAddress($order_id)
{
$order = DB::connection('order')->table('lie_order_address')->where('order_id', $order_id)->select('consignee')->first();
if (!$order) return false;
return $order->consignee;
return OrderAddressModel::where('order_id', $order_id)->value('consignee');
}
// 获取渠道名称
......@@ -310,7 +291,7 @@ function getOrderExtend($order_id, $field="*", $where=array())
$map = array_merge($map, $where);
}
$extend = DB::connection('order')->table('lie_order_extend')->where($map)->select($field)->first();
$extend = OrderExtendModel::where($map)->select($field)->first();
return $extend;
}
......@@ -803,7 +784,7 @@ Class OrderController extends Controller
// 详情页自营其他数据
public function selfOtherData(&$info, $order_id)
{
$shipping = DB::connection('order')->table('lie_shipping')->select('shipping_id', 'shipping_name')->get();
$shipping = ShippingModel::select('shipping_id', 'shipping_name')->get();
$info['shippings'] = [];
......@@ -815,7 +796,7 @@ Class OrderController extends Controller
$info['shippings'] = $shippingInfo;
}
$extend = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $order_id, 'order_type' => 3])->first(); // 自营线下订单
$extend = OrderExtendModel::where(['order_id' => $order_id, 'order_type' => 3])->first(); // 自营线下订单
$info['extend'] = $extend ? $extend : '';
}
......@@ -1132,7 +1113,7 @@ Class OrderController extends Controller
$order_id = $request->input('order_id');
// 调价失败临时表状态更改
$order_temp = DB::connection('order')->table('lie_order_extend')->where(['order_id' => $order_id])->update(['status' => -1]);
$order_temp = OrderExtendModel::where(['order_id' => $order_id])->update(['status' => -1]);
if (!$order_temp) {
errorLog(Error::E_UPDATE_FAILED, '驳回失败');
......@@ -1305,37 +1286,6 @@ Class OrderController extends Controller
}
}
// 审核不通过
// public function ajaxCheck(Request $request)
// {
// if($request->isMethod('post')){
// $order_id = $request->input('order_id', ''); //订单号
// $sale_id = $request->input('sale_id', null); //对应销售
// $operator_id = $request->user->userId;
// $cancel_reason = $request->input('cancel_reason', '');
// if (!isset($sale_id)) {
// return array('errcode'=>1, 'errmsg'=>'请选择订单业务员!');
// }
// if (!$order_id) {
// return array('errcode'=>1, 'errmsg'=>'订单参数有误!');
// }
// //用于后台订单审核
// $url = Config('website.api_domain').'order/cancel';
// $check['k1'] = time();
// $check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
// $resData = array("cancel_reason"=>$cancel_reason, "order_id"=>$order_id, 'sale_id'=>$sale_id, "pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], 'operator_id'=>$operator_id, 'type' => 3);
// $temp = json_decode(curlApi($url, $resData, "POST"), true);
// return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
// }
// }
// 对账
public function checkPay(Request $request, $id)
{
......@@ -1371,7 +1321,7 @@ Class OrderController extends Controller
} else {
$payLog['is_paid'] = 2;
if (DB::connection('order')->table('lie_pay_log')->where(['order_id'=>$order_id, 'pay_type'=>2])->update($payLog)) {
if (PayLogModel::where(['order_id'=>$order_id, 'pay_type'=>2])->update($payLog)) {
return array('errcode'=>0,'errmsg'=>'操作成功');
}
}
......@@ -1518,11 +1468,11 @@ Class OrderController extends Controller
$map['rec_id'] = $v['rec_id'];
$map['goods_id'] = $v['goods_id'];
// 获取出库数量
$removal = DB::connection('order')->table('lie_removal_items')->where($map)->select('removal_number')->first();
$removal = RemovalItemsModel::where($map)->select('removal_number')->first();
$v['removal_number'] = $removal ? $removal->removal_number : 0;
// 获取已申请退货数量
$v['already_return_num'] = DB::connection('order')->table('lie_order_return_items')->where($map)->sum('return_num');
$v['already_return_num'] = OrderReturnItemsModel::where($map)->sum('return_num');
}
return view('detail', $info);
......@@ -1684,7 +1634,7 @@ Class OrderController extends Controller
$info = $this->orderDetail($request, $id);
$this->pageHeader($request, $info, '发货', ["title" => '发货', "href" => '#']);
$shippings = DB::connection('order')->table('lie_shipping')->where(['enabled'=>1,'is_order'=>1])->get();//获取配送方式
$shippings = ShippingModel::where(['enabled'=>1,'is_order'=>1])->get();//获取配送方式
$ship_type = [];
foreach ($shippings as $key => $value) {
......@@ -1737,7 +1687,7 @@ Class OrderController extends Controller
}
//物流信息
$shippings = DB::connection('order')->table('lie_shipping')->where(['enabled'=>1,'is_invoice'=>1])->get();
$shippings = ShippingModel::where(['enabled'=>1,'is_invoice'=>1])->get();
$shippingArr = [];
foreach ($shippings as $key => $value) {
......@@ -1779,10 +1729,10 @@ Class OrderController extends Controller
// }
// 获取操作记录
$actionLog = DB::connection('order')->table('lie_order_action_log')->where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
$actionLog = OrderActionLogModel::where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
// 获取ERP支付记录
$erpPayLog = DB::connection('order')->table('lie_erp_pay_log')->where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
$erpPayLog = ErpPayLogModel::where('order_id', $id)->orderBy('create_time', 'DESC')->orderBy('log_id', 'DESC')->get();
$response = [
// 'user_mobile' => $mobile,
......@@ -1992,9 +1942,7 @@ Class OrderController extends Controller
*/
public function checkOrderSendSms()
{
$order = DB::connection('order')
->table('lie_order')
->where('order_goods_type', '=', 1)
$order = OrderModel::where('order_goods_type', '=', 1)
->where('status', '=', 2)
// ->whereNotIn('user_id', $this->testMobile())
->where('is_type', '=', 0)
......@@ -2061,9 +2009,9 @@ Class OrderController extends Controller
{
$time = strtotime(date('Y-m-d', time())); // 当天0点
$order = DB::connection('order')
->table('lie_order')
->where('order_goods_type', '=', 1)
$OrderModel = new OrderModel;
$order = $OrderModel->where('order_goods_type', '=', 1)
->where('order_pay_type', '<>', 3) // 过滤账期订单
->where('status', '=', 2)
// ->whereNotIn('user_id', $this->testMobile())
......@@ -2077,10 +2025,7 @@ Class OrderController extends Controller
foreach ($order as $v) {
// 到达付款时间后自动取消订单
if ($v->pay_time <= time()) {
$update = DB::connection('order')
->table('lie_order')
->where('order_id', '=', $v->order_id)
->update(['status' => -1, 'pay_time' => 0, 'cancel_time' => time()]);
$update = $OrderModel->where('order_id', '=', $v->order_id)->update(['status' => -1, 'pay_time' => 0, 'cancel_time' => time()]);
if ($update) {
// 操作记录
......@@ -2109,11 +2054,11 @@ Class OrderController extends Controller
return ['errcode'=>Error::E_NOT_EXISTS, 'errmsg'=>'参数不存在'];
}
$order = DB::connection('order')->table('lie_order')->where('order_id', '=', $order_id)->select('pay_time')->first();
$order = OrderModel::where('order_id', '=', $order_id)->select('pay_time')->first();
$delay_time = $order->pay_time + $delay_time * 86400;
$update = DB::connection('order')->table('lie_order')->where('order_id', '=', $order_id)->update(['pay_time'=>$delay_time]);
$update = OrderModel::where('order_id', '=', $order_id)->update(['pay_time'=>$delay_time]);
if (!$update) {
errorLog(Error::E_UPDATE_FAILED, '延长失败');
......@@ -2163,7 +2108,7 @@ Class OrderController extends Controller
$data['contract_link_tel'] = $request->input('contract_link_tel', '');
DB::connection('order')->transaction(function() use ($request, $order_id, $data) {
DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->update($data);
OrderExtendModel::where('order_id', $order_id)->update($data);
$OrderActionLogModel = new OrderActionLogModel();
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '编辑合同乙方信息'); // 操作记录
......@@ -2181,8 +2126,8 @@ Class OrderController extends Controller
$data['upload_contract_url'] = $request->input('url');
DB::connection('order')->transaction(function() use ($request, $order_id, $data) {
DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update(['erp_syn'=>1]); // 标记ERP同步
DB::connection('order')->table('lie_order_extend')->where('order_id', $order_id)->update($data);
OrderModel::where('order_id', $order_id)->update(['erp_syn'=>1]); // 标记ERP同步
OrderExtendModel::where('order_id', $order_id)->update($data);
$OrderActionLogModel = new OrderActionLogModel();
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '回传合同'); // 操作记录
......@@ -2220,17 +2165,13 @@ Class OrderController extends Controller
$testMobile = $userMainModel->testMobile();
// 订单数量
$halfCount = DB::connection('order')->table('lie_order')
// ->where('order_goods_type', 1)
// ->where('order_type', 1)
->whereNotIn('user_id', $testMobile)
$halfCount = OrderModel::whereNotIn('user_id', $testMobile)
->where('is_type', 0)
->whereBetween('create_time', [$half, $current])
->count();
echo '半年订单数:'.$halfCount.'<br>';
$yearCount = DB::connection('order')->table('lie_order')
->whereNotIn('user_id', $testMobile)
$yearCount = OrderModel::whereNotIn('user_id', $testMobile)
->where('is_type', 0)
->whereBetween('create_time', [$year, $current])
->count();
......@@ -2285,7 +2226,7 @@ Class OrderController extends Controller
// 查找用户订单数,并更新用户表和订单扩展表
$subQuery = OrderModel::where('is_type', '=', 0)->where('status', '<>', -1)->orderBy('order_id');
DB::connection('order')->table('lie_order_extend')->update(['is_new' => 0]); // 是否新订单恢复默认值0
OrderExtendModel::update(['is_new' => 0]); // 是否新订单恢复默认值0
OrderModel::from(DB::raw("({$subQuery->toSql()}) as sub"))
->mergeBindings($subQuery->getQuery())
......@@ -2304,17 +2245,17 @@ Class OrderController extends Controller
}
// 更新用户
DB::connection('order')->table('lie_user_main')->where('user_id', $v->user_id)->update($new_user);
UserMainModel::where('user_id', $v->user_id)->update($new_user);
$extend = DB::connection('order')->table('lie_order_extend')->where('order_id', $v->order_id)->first();
$extend = OrderExtendModel::where('order_id', $v->order_id)->first();
if ($extend) {
// 更新订单
DB::connection('order')->table('lie_order_extend')->where('order_id', $v->order_id)->update($new_order);
OrderExtendModel::where('order_id', $v->order_id)->update($new_order);
} else {
// 创建
$new_order['order_id'] = $v->order_id;
DB::connection('order')->table('lie_order_extend')->insert($new_order);
OrderExtendModel::insert($new_order);
}
}
});
......
......@@ -4,13 +4,14 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Page;
use App\Http\Controllers\Controller;
use App\Model\UserMainModel;
use App\Model\OrderModel;
use App\Model\PayLogModel;
use App\Model\OrderRefundModel;
use App\Model\OrderRefundItemsModel;
use DB;
use App\Http\Page;
use App\Model\UserMainModel;
// 获取会员账号
function getAccountName($user_id)
......@@ -43,21 +44,15 @@ function getOrderAmount($order_id)
// 获取支付名称
function getPayName($order_id)
{
$payLog = DB::connection('order')
->table('lie_pay_log')
->where(['order_id' => $order_id])
->select('pay_name')
->get();
$payLog = PayLogModel::where(['order_id' => $order_id])->select('pay_name')->get();
if ($payLog->isEmpty()) return false;
if (!empty($payLog)) {
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
}
return implode(',', $payName);
}
return false;
}
class RefundController extends Controller
......@@ -225,7 +220,7 @@ class RefundController extends Controller
{
$refund_id = $request->input('refund_id');
$update = DB::connection('order')->table('lie_order_refund')->where('refund_id', $refund_id)->update(['status' => -1]);
$update = OrderRefundModel::where('refund_id', $refund_id)->update(['status' => -1]);
if (!$update) return ['errcode' => 1, 'errmsg' => '取消申请失败'];
......
......@@ -11,7 +11,7 @@ class RegionController extends Controller
public function getAll()
{
$provinces = array(); $citys = array(); $towns = array();
$list = DB::connection('order')->table('lie_region')->orderBy('region_id', 'asc')->get();
$list = RegionModel::orderBy('region_id', 'asc')->get();
foreach (@$list as $val) {
if (!$val->parent_id) continue;
......@@ -45,7 +45,7 @@ class RegionController extends Controller
if (empty($region_id)){
return "";
}
$list = DB::connection('order')->table('lie_region')->select("region_name")->where("region_id",$region_id)->get();
$list = RegionModel::select("region_name")->where("region_id",$region_id)->get();
return !$list ? "" : current(objectToArray($list))['region_name'];
}
......
......@@ -3,34 +3,30 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis;
use App\Http\Requests;
use App\Http\Page;
use App\Http\Controllers\Controller;
use App\Model\OrderModel;
use App\Model\OrderReturnModel;
use App\Model\OrderReturnItemsModel;
use DB;
use App\Http\Page;
use App\Model\PayLogModel;
use App\Model\UserMainModel;
use Illuminate\Support\Facades\Redis;
use App\Model\ShippingModel;
use DB;
// 获取支付名称
function getPayName($order_id)
{
$payLog = DB::connection('order')
->table('lie_pay_log')
->where(['order_id' => $order_id])
->select('pay_name')
->get();
$payLog = PayLogModel::where(['order_id' => $order_id])->select('pay_name')->get();
if ($payLog->isEmpty()) return false;
if (!empty($payLog)) {
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
}
return implode(',', $payName);
}
return false;
}
// 获取交易员名称
......@@ -46,7 +42,7 @@ function getSalesName($sale_id)
// 获取物流名称
function getShippingName($shipping_id)
{
$shipping = DB::connection('order')->table('lie_shipping')->where('shipping_id', $shipping_id)->select('shipping_name')->first();
$shipping = ShippingModel::where('shipping_id', $shipping_id)->select('shipping_name')->first();
return $shipping ? $shipping->shipping_name : '';
}
......@@ -152,7 +148,7 @@ class ReturnController extends Controller
$show = $page->show();
// 获取配送方式
$shippings = DB::connection('order')->table('lie_shipping')->get();
$shippings = ShippingModel::get();
$ship_type = [];
foreach ($shippings as $k => $v) {
......
......@@ -40,14 +40,14 @@ class SpecialController extends Controller
DB::connection('order')->beginTransaction();
$order = DB::connection('order')->table('lie_order_price')->where('order_id', $order_id)->where('price_type', 3)->first();
$order = OrderPriceModel::where('order_id', $order_id)->where('price_type', 3)->first();
if (!$order) {
echo '运费不存在';die;
}
$data['price'] = 0;
$update = DB::connection('order')->table('lie_order_price')->where('order_id', $order_id)->where('price_type', 3)->update($data);
$update = OrderPriceModel::where('order_id', $order_id)->where('price_type', 3)->update($data);
if (!$update) {
DB::connection('order')->rollback();
......
......@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Page;
use App\Map\PcbOrderInvoiceMap;
use App\Map\PcbOrderMap;
......@@ -15,12 +17,9 @@ use App\Model\PaymentDaysModel;
use App\Model\Pcb\PcbOrderModel;
use App\Model\Pcb\PcbPublicModel;
use App\Model\Pcb\PcbPurchaseModel;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Controllers\PermController;
use DB;
use App\Model\UserMainModel;
use App\Model\UserInfoModel;
use App\Model\UserCompanyModel;
......@@ -31,6 +30,8 @@ use App\Model\OrderServiceLogModel;
use App\Model\OrderExtendModel;
use App\Model\PayLogModel;
use App\Model\OrderInvoiceModel;
use App\Model\ShippingModel;
use DB;
class WebController extends Controller
{
......@@ -97,7 +98,7 @@ class WebController extends Controller
$data['title']='PCB交易列表';
$data['order_type'] = PcbOrderMap::$order_type;
$data['status'] = PcbOrderMap::$status;
$data['shipping'] = objectToArray(DB::connection("order")->table("lie_shipping")->get());
$data['shipping'] = objectToArray(ShippingModel::get());
//分页
$response = (new PcbOrderModel())->getList();
$page = new Page($response[3], 10);
......@@ -164,7 +165,7 @@ class WebController extends Controller
$orderBase['create_time'] = $orderBase['create_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['create_time']) : "";
$orderBase['finish_time'] = $orderBase['finish_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['finish_time']) : "";
$orderBase['pay_time'] = $orderBase['pay_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['pay_time']) : "";
$userCompany = DB::connection('order')->table("lie_user_company")->where("user_id",$orderBase['user_id'])->first();
$userCompany = UserCompanyModel::where("user_id",$orderBase['user_id'])->first();
$orderBase['company_name'] = $userCompany ? $userCompany->com_name : "" ;
//拼接收货信息
$RegionController = new RegionController();
......@@ -250,7 +251,7 @@ class WebController extends Controller
$orderBase['create_time'] = $orderBase['create_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['create_time']) : "";
$orderBase['finish_time'] = $orderBase['finish_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['finish_time']) : "";
$orderBase['pay_time'] = $orderBase['pay_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['pay_time']) : "";
$userCompany = DB::connection('order')->table("lie_user_company")->where("user_id",$orderBase['user_id'])->first();
$userCompany = UserCompanyModel::where("user_id",$orderBase['user_id'])->first();
$orderBase['company_name'] = $userCompany ? $userCompany->com_name : "" ;
//拼接采购信息
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class InvoiceCompanyModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_invoice_company';
protected $primaryKey = 'id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class RemovalItemsModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_removal_items';
protected $primaryKey = 'removal_items_id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class ShippingModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_shipping';
protected $primaryKey = 'shipping_id';
public $timestamps = false;
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ use Request;
class ShoppingCartModel extends Model
{
protected $connection = 'order';
protected $connection = 'web';
protected $table = 'lie_shopping_cart';
protected $primaryKey = 'cart_id';
public $timestamps = false;
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class TaxInfoModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_taxinfo';
protected $primaryKey = 'tax_id';
public $timestamps = false;
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class UserAddressModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_user_address';
protected $primaryKey = 'address_id';
public $timestamps = false;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ use App\Model\RegionModel;
class UserCompanyModel extends Model
{
protected $connection = 'order';
protected $connection = 'web';
protected $table = 'lie_user_company';
protected $primaryKey = 'com_id';
public $timestamps = false;
......
......@@ -8,7 +8,7 @@ use DB;
class UserMainModel extends Model
{
protected $connection = 'order';
protected $connection = 'web';
protected $table = 'lie_user_main';
protected $primaryKey = 'user_id';
public $timestamps = false;
......
......@@ -71,16 +71,29 @@ return [
'strict' => false,
],
'order' => [
'web' => [
'driver' => 'mysql',
'host' => env('DB_HOST', ''),
'database' => env('DB_DATABASE_WEB', ''),
'username' => env('DB_USERNAME_WEB', ''),
'password' => env('DB_PASSWORD_WEB', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'order' => [
'driver' => 'mysql',
'host' => env('DB_HOST_ORDER', ''),
'database' => env('DB_DATABASE_ORDER', ''),
'username' => env('DB_USERNAME_ORDER', ''),
'password' => env('DB_PASSWORD_ORDER', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'prefix' => env('DB_PREFIX_ORDER', ''),
'strict' => false,
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment