Commit f1360c56 by 朱继来

Merge branch 'zjl_order_limit_20220218'

parents 30c3a842 22a1aed7
......@@ -919,27 +919,29 @@ Class OrderController extends Controller
if ($count > $order_user_limit) return ['errcode'=>11001, 'errmsg'=>'你已达到成交用户上限,请先释放你跟进的已下单用户或联系主管重新分配当前用户'];
}
$perm = new PermController;
$OrderModel = new OrderModel;
$relation_id = [];
$order_sale_id = $OrderModel->where('order_id', $order_id)->value('sale_id'); // 获取当前订单销售
array_push($relation_id, $order_sale_id);
$manager = $perm->getSuperiorManager($order_sale_id, '销售经理'); // 获取销售主管
if ($manager) {
$manager_id = array_column($manager, 'userId');
$relation_id = array_merge($relation_id, $manager_id);
}
$director = $perm->getSuperiorDirector($order_sale_id, '销售总监'); // 获取销售总监
if ($director) {
$director_id = array_column($director, 'userId');
$relation_id = array_merge($relation_id, $director_id);
}
if ($request->user->email != 'admin@ichunt.com') {
$perm = new PermController;
$OrderModel = new OrderModel;
$relation_id = [];
$order_sale_id = $OrderModel->where('order_id', $order_id)->value('sale_id'); // 获取当前订单销售
array_push($relation_id, $order_sale_id);
$manager = $perm->getSuperiorManager($order_sale_id, '销售经理'); // 获取销售主管
if ($manager) {
$manager_id = array_column($manager, 'userId');
$relation_id = array_merge($relation_id, $manager_id);
}
$director = $perm->getSuperiorDirector($order_sale_id, '销售总监'); // 获取销售总监
if ($director) {
$director_id = array_column($director, 'userId');
$relation_id = array_merge($relation_id, $director_id);
}
// 校验此是否为此订单销售或者对应主管,总监
if (!in_array($request->user->userId, $relation_id)) return ['errcode'=>-1, 'errmsg'=>'你没有权限操作此销售订单!'];
// 校验此是否为此订单销售或者对应主管,总监
if (!in_array($request->user->userId, $relation_id)) return ['errcode'=>-1, 'errmsg'=>'你没有权限操作此销售订单!'];
}
if (!$request->input('pay_time_limit')) {
$payTime = $request->input('payTime', '');
......
......@@ -8,8 +8,8 @@ use DB;
class InvoiceCompanyModel extends Model
{
protected $connection = 'web';
protected $table = 'lie_invoice_company';
protected $connection = 'crm';
protected $table = 'invoice_company';
protected $primaryKey = 'id';
public $timestamps = false;
......
......@@ -32,6 +32,7 @@
<input type="hidden" name="check_failed_info" value="">
<input type="hidden" name="change_pay_type" value="">
<input type="hidden" name="business_type" value="{{$order_temp_info['business_type']}}">
<input type="hidden" class="tax_id" name="tax_id" value="{{ isset($order_invoice_info['tax_id']) ? $order_invoice_info['tax_id'] : '' }}">
<?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?>
@if ($isNewClient)
......
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