hyperf框架下对word合同文档模版的处理
composer require phpoffice/phpword
composer require picqer/php-barcode-generator
public function download_contract($param)
{
$order = Order::query()
->where("order_depot_id", $param['order_depot_id'])
->where('merchants_user', $param['user_id'])
->select('order_depot_id')->get()->toArray();
$order_id = array_column($order,'order_depot_id');
if (empty($order)) {
$order = Order::query()
->where("order_depot_id", $param['order_depot_id'])
->whereIn('shop_salesman_id',$param['data_scope_user_ids'])
->orderByDesc('created_at')
->select('order_depot_id')->get()->toArray();
$order_id = array_column($order,'order_depot_id');
}
if (empty($order_id)){
return error('00203', '订单不存在', []);
}
$filed = ['id', 'type', 'orderno','recipient', 'contact', 'amount', 'province', 'city', 'district', 'town', 'address', 'remark'];
$order = OrderDepot::query()->whereIn(