京东打印
This commit is contained in:
parent
a054dab135
commit
2f71543507
@ -18,6 +18,9 @@ class WayBillService
|
|||||||
public $adminUser;
|
public $adminUser;
|
||||||
// 标准模板
|
// 标准模板
|
||||||
public $templateUrl = 'https://template-content.jd.com/template-oss?tempCode=jdkd76x130';
|
public $templateUrl = 'https://template-content.jd.com/template-oss?tempCode=jdkd76x130';
|
||||||
|
// 标准模板
|
||||||
|
public $customerTempUrl = "https://template-content.jd.com/template-open?templateCode=customerInfo";
|
||||||
|
|
||||||
// 时效类型
|
// 时效类型
|
||||||
public $timedDeliveryCode;
|
public $timedDeliveryCode;
|
||||||
|
|
||||||
@ -55,6 +58,8 @@ class WayBillService
|
|||||||
if (!empty($resp[0]['perPrintData'])) {
|
if (!empty($resp[0]['perPrintData'])) {
|
||||||
$waybill->status = Waybill::$STATUS_CREATE_WAYBILL_ENCRYPTED_DATA;
|
$waybill->status = Waybill::$STATUS_CREATE_WAYBILL_ENCRYPTED_DATA;
|
||||||
$waybill->templateUrl = $this->templateUrl;
|
$waybill->templateUrl = $this->templateUrl;
|
||||||
|
$waybill->customer_temp_url = $this->customerTempUrl;
|
||||||
|
$waybill->customer_temp_data = json_encode(['productInfo' => $item['productInfo']], 256);
|
||||||
$waybill->encryptedData = $resp[0]['perPrintData'];
|
$waybill->encryptedData = $resp[0]['perPrintData'];
|
||||||
$waybill->save();
|
$waybill->save();
|
||||||
}
|
}
|
||||||
@ -251,8 +256,7 @@ class WayBillService
|
|||||||
];
|
];
|
||||||
$note .= $item['goods_name'] . " " . $count . "件,";
|
$note .= $item['goods_name'] . " " . $count . "件,";
|
||||||
}
|
}
|
||||||
$note .= "[备注:" . $info['note'] . "]";
|
$info['productInfo'] = $note;
|
||||||
$info['note'] = $note;
|
|
||||||
$this->orders[$order['shop_id']][] = $info;
|
$this->orders[$order['shop_id']][] = $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +266,8 @@ class WayBillService
|
|||||||
private function getShopSend($shopId)
|
private function getShopSend($shopId)
|
||||||
{
|
{
|
||||||
return ShopSender::query()
|
return ShopSender::query()
|
||||||
->where('status', 1)->orderBy('sort')
|
->where('shop_id', $shopId)
|
||||||
|
->where('status', 1)->orderByDesc('sort')
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddCustomerTempUrlToWaybillsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (Schema::hasColumns('waybills', ["customer_temp_url"])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Schema::table('waybills', function (Blueprint $table) {
|
||||||
|
$table->string('customer_temp_url', 191)->default('')->comment('自定义模版url');
|
||||||
|
$table->text('customer_temp_data')->nullable()->comment('自定义模版参数');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Schema::table('waybills', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->dropColumn('customer_temp_url');
|
||||||
|
$table->dropColumn('customer_temp_data');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user