| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use app\models\Admin;
- use app\models\AgentFrontBind;
- use app\models\Store;
- use app\modules\admin\models\AgentFrontForm;
- class AgentFrontController extends BaseController
- {
- //前置仓列表
- public function actionList() {
- $form = new AgentFrontForm();
- $form->name = input_params('name');
- $form->admin_id = get_admin()->id;
- $form->admin = get_admin();
- $res = $form->list();
- return $this->asJson($res);
- }
- //前置仓名称ID列表
- public function actionNameList() {
- $form = new AgentFrontForm();
- $form->admin_id = get_admin()->id;
- $form->admin = get_admin();
- $res = $form->list(1);
- return $this->asJson($res);
- }
- //前置仓绑定关系(商家)列表
- public function actionBindStoreList() {
- $form = new AgentFrontForm();
- $form->admin_id = get_admin()->id;
- $form->admin = get_admin();
- $form->status = input_params('status', -1);
- $form->type = input_params('type', 0);
- $form->store_name = input_params('store_name');
- $form->md_name = input_params('md_name');
- $form->store_phone = input_params('store_phone');
- $form->front_agent_admin_id = input_params('front_agent_admin_id');
- $form->md_id = input_params('md_id');
- $form->store_id = input_params('store_id');
- $res = $form->bindStoreList();
- return $this->asJson($res);
- }
- //前置仓绑定关系(供货商)列表
- public function actionBindList() {
- $form = new AgentFrontForm();
- $form->admin_id = get_admin()->id;
- $form->admin = get_admin();
- $form->supplier_id = input_params('supplier_id');
- $form->supplier_name = input_params('supplier_name');
- $form->supplier_phone = input_params('supplier_phone');
- $type = input_params('type');
- $form->front_agent_admin_id = input_params('front_agent_admin_id');
- $form->front_agent_admin_name = input_params('front_agent_admin_name');
- $form->store_name = input_params('store_name');
- $form->store_id = input_params('store_id');
- $form->status = input_params('status', -1);
- $res = $form->bindList($type);
- return $this->asJson($res);
- }
- //前置仓绑定关系(供货商/商家)
- public function actionBind() {
- $form = new AgentFrontForm();
- $form->admin_id = get_admin()->id;
- $form->admin = get_admin();
- $id = input_params('id');
- $status = input_params('status', 0);
- $type = post_params('type');
- $form->supplier_id = input_params('supplier_id');
- $form->store_id = input_params('store_id');
- $form->admin_id = get_admin()->id;
- $form->front_agent_admin_id = input_params('front_agent_admin_id');
- $form->is_cloud_delivery = input_params('is_cloud_delivery');
- $res = $form->bind($id, $status, $type);
- return $this->asJson($res);
- }
- //前置仓绑定关系状态修改
- public function actionBindStatus() {
- $form = new AgentFrontForm();
- $ids = input_params('ids');
- $status = input_params('status', 0);
- $res = $form->bindStatus($ids, $status);
- return $this->asJson($res);
- }
- //前置仓绑定关系删除
- public function actionBindDel() {
- $form = new AgentFrontForm();
- $ids = input_params('ids');
- $res = $form->bindDel($ids);
- return $this->asJson($res);
- }
- //店铺已绑定前置仓绑定店铺门店
- public function actionAgentFrontBindStoreMd() {
- $form = new AgentFrontForm();
- $form->store_id = get_store_id();
- $form->md_id = input_params('md_id');
- $form->front_agent_admin_id = input_params('front_agent_admin_id');
- $form->id = input_params('id');
- return $this->asJson($form->agentFrontBindStoreMd());
- }
- //仓库对应的仓库同城订单
- public function actionAgentFrontDeliveryOrder() {
- $form = new AgentFrontForm();
- // $form->store_id = get_store_id();
- $form->attributes = get_params();
- $admin = get_admin();
- if ($admin->type === Admin::ADMIN_TYPE_FRONT_AGENT) {
- $form->front_agent_admin_id = $admin->id;
- }
- if ($admin->type === Admin::ADMIN_TYPE_SUPPLIER) {
- $form->supplier_id = $admin->type_id;
- }
- return $this->asJson($form->agentFrontDeliveryOrder());
- }
- public function actionGetStoreBindFrontAgent() {
- $store_id = get_store_id();
- return $this->asJson([
- 'code' => 0,
- 'msg' => '',
- 'data' => AgentFrontBind::getStoreBindFrontAgent($store_id)
- ]);
- }
- /**
- * 仓库对应的仓库快递订单
- */
- public function actionAgentFrontExpressOrder() {
- $form = new AgentFrontForm();
- $form->attributes = get_params();
- $admin = get_admin();
- if ($admin->type === Admin::ADMIN_TYPE_FRONT_AGENT) {
- $form->front_agent_admin_id = $admin->id;
- }
- if ($admin->type === Admin::ADMIN_TYPE_SUPPLIER) {
- $form->supplier_id = $admin->type_id;
- }
- return $this->asJson($form->agentFrontExpressOrder());
- }
- /**
- * 仓库发货仓库快递订单
- */
- public function actionAgentFrontExpressSendOrder() {
- $form = new AgentFrontForm();
- $form->attributes = post_params();
- $admin = get_admin();
- if ($admin->type === Admin::ADMIN_TYPE_FRONT_AGENT) {
- $form->front_agent_admin_id = $admin->id;
- }
- return $this->asJson($form->agentFrontExpressSendOrder());
- }
- }
|