Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
48de1eb9ea
|
|
@ -2,72 +2,67 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'name' => 'key',
|
'name' => 'key',
|
||||||
'title' => '应用key',
|
'title' => '应用key',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => 'your key',
|
'value' => 'LTAI5t87F5mAkaXVKfLcmnrB',
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '',
|
'tip' => '',
|
||||||
'ok' => '',
|
'ok' => '',
|
||||||
'extend' => '',
|
'extend' => '',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'secret',
|
'name' => 'secret',
|
||||||
'title' => '密钥secret',
|
'title' => '密钥secret',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => 'your secret',
|
'value' => 'fk7KgdqRdJUS6Jc99TlB6mNLKorrsD',
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '',
|
'tip' => '',
|
||||||
'ok' => '',
|
'ok' => '',
|
||||||
'extend' => '',
|
'extend' => '',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'sign',
|
'name' => 'sign',
|
||||||
'title' => '签名',
|
'title' => '签名',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => 'your sign',
|
'value' => '超邦手',
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '',
|
'tip' => '',
|
||||||
'ok' => '',
|
'ok' => '',
|
||||||
'extend' => '',
|
'extend' => '',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'template',
|
'name' => 'template',
|
||||||
'title' => '短信模板',
|
'title' => '短信模板',
|
||||||
'type' => 'array',
|
'type' => 'array',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => [
|
'value' => [
|
||||||
'register' => 'SMS_114000000',
|
'stop_custom' => 'SMS_487200413',
|
||||||
'resetpwd' => 'SMS_114000000',
|
'start_custom' => 'SMS_487260356',
|
||||||
'changepwd' => 'SMS_114000000',
|
'start_worker' => 'SMS_487375365',
|
||||||
'changemobile' => 'SMS_114000000',
|
|
||||||
'profile' => 'SMS_114000000',
|
|
||||||
'notice' => 'SMS_114000000',
|
|
||||||
'mobilelogin' => 'SMS_114000000',
|
|
||||||
'bind' => 'SMS_114000000',
|
|
||||||
],
|
],
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '',
|
'tip' => '',
|
||||||
'ok' => '',
|
'ok' => '',
|
||||||
'extend' => '',
|
'extend' => '',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => '__tips__',
|
'name' => '__tips__',
|
||||||
'title' => '温馨提示',
|
'title' => '温馨提示',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'content' => [],
|
'content' => [],
|
||||||
'value' => '应用key和密钥你可以通过 https://ak-console.aliyun.com/?spm=a2c4g.11186623.2.13.fd315777PX3tjy#/accesskey 获取',
|
'value' => '应用key和密钥你可以通过 https://ak-console.aliyun.com/?spm=a2c4g.11186623.2.13.fd315777PX3tjy#/accesskey 获取',
|
||||||
'rule' => 'required',
|
'rule' => 'required',
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'tip' => '',
|
'tip' => '',
|
||||||
'ok' => '',
|
'ok' => '',
|
||||||
'extend' => '',
|
'extend' => '',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ author = FastAdmin
|
||||||
website = https://www.fastadmin.net
|
website = https://www.fastadmin.net
|
||||||
version = 1.0.10
|
version = 1.0.10
|
||||||
state = 1
|
state = 1
|
||||||
url = http://fast.cc:8088/addons/alisms
|
url = http://127.0.0.1:8088/addons/alisms
|
||||||
license = regular
|
license = regular
|
||||||
licenseto = 15976
|
licenseto = 15976
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
namespace addons\alisms\library;
|
namespace addons\alisms\library;
|
||||||
|
|
||||||
|
use think\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 阿里大于SMS短信发送
|
* 阿里大于SMS短信发送
|
||||||
*/
|
*/
|
||||||
|
|
@ -91,6 +93,12 @@ class Alisms
|
||||||
{
|
{
|
||||||
$this->error = '';
|
$this->error = '';
|
||||||
$params = $this->_params();
|
$params = $this->_params();
|
||||||
|
Db::name('sms_record')->insert([
|
||||||
|
'receiver' => $params['PhoneNumbers'],
|
||||||
|
'content' => $params['TemplateParam'],
|
||||||
|
'template_id' => $params['TemplateCode'],
|
||||||
|
]);
|
||||||
|
return true;
|
||||||
$params['Signature'] = $this->_signed($params);
|
$params['Signature'] = $this->_signed($params);
|
||||||
$response = $this->_curl($params);
|
$response = $this->_curl($params);
|
||||||
if ($response !== false) {
|
if ($response !== false) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ namespace app\admin\command;
|
||||||
|
|
||||||
use app\admin\addresmart\Address;
|
use app\admin\addresmart\Address;
|
||||||
use app\admin\controller\orders\DispatchLogic;
|
use app\admin\controller\orders\DispatchLogic;
|
||||||
|
use app\admin\controller\SendMailLogic;
|
||||||
use app\admin\model\Order;
|
use app\admin\model\Order;
|
||||||
use app\admin\model\OrderDispatch;
|
use app\admin\model\OrderDispatch;
|
||||||
use app\admin\model\OrderReview;
|
use app\admin\model\OrderReview;
|
||||||
|
|
@ -31,9 +32,12 @@ class Test extends Command
|
||||||
|
|
||||||
protected function execute(Input $input, Output $output)
|
protected function execute(Input $input, Output $output)
|
||||||
{
|
{
|
||||||
$order = (new Order())->find(110);
|
// $ret = SendMailLogic::sendToCustomStart('13038128325','今日的风儿','173xxxxxxxx');
|
||||||
$id = (new DispatchLogic())->getMaxScoreWorker($order);
|
$ret = SendMailLogic::sendToCustomStop('17381847365');
|
||||||
dd($id);
|
dd($ret);
|
||||||
|
// dd($ret);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ class Order extends Backend
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new \app\admin\model\Order;
|
$this->model = new \app\admin\model\Order;
|
||||||
$this->view->assign("statusList", $this->model->getStatusList());
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
|
|
||||||
$sources = Db::name('source')
|
$sources = Db::name('source')
|
||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->field(['id', 'title', 'key_word', 'pid'])
|
->field(['id', 'title', 'key_word', 'pid'])
|
||||||
|
|
@ -196,7 +195,7 @@ class Order extends Backend
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
$params = array_filter($params,function ($val){
|
$params = array_filter($params, function ($val) {
|
||||||
return $val != '';
|
return $val != '';
|
||||||
});
|
});
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
|
@ -221,7 +220,7 @@ class Order extends Backend
|
||||||
$sources = array_column($sources, 'title', 'id');
|
$sources = array_column($sources, 'title', 'id');
|
||||||
$params['source_shop'] = $sources[$params['source']] ?? null;
|
$params['source_shop'] = $sources[$params['source']] ?? null;
|
||||||
|
|
||||||
$params['item_title'] = $this->findElementByValue($this->itemsformattedTree,$params['item_id'] ?? null);
|
$params['item_title'] = $this->findElementByValue($this->itemsformattedTree, $params['item_id'] ?? null);
|
||||||
|
|
||||||
|
|
||||||
$params['admin_id'] = ($params['admin_id'] ?? -1) == -1 ? $this->auth->id : $params['admin_id'];
|
$params['admin_id'] = ($params['admin_id'] ?? -1) == -1 ? $this->auth->id : $params['admin_id'];
|
||||||
|
|
@ -243,7 +242,7 @@ class Order extends Backend
|
||||||
$hookparams['order'] = $this->model;
|
$hookparams['order'] = $this->model;
|
||||||
$hookparams['role'] = 1;
|
$hookparams['role'] = 1;
|
||||||
$hookparams['auth'] = $this->auth;
|
$hookparams['auth'] = $this->auth;
|
||||||
$hookparams['remark'] = $params['remark']??'';
|
$hookparams['remark'] = $params['remark'] ?? '';
|
||||||
Hook::listen('order_change', $hookparams);
|
Hook::listen('order_change', $hookparams);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
|
@ -297,7 +296,7 @@ class Order extends Backend
|
||||||
$params['admin_id'] = $this->auth->id;
|
$params['admin_id'] = $this->auth->id;
|
||||||
}
|
}
|
||||||
$params['source_shop'] = $sources[$params['source']] ?? null;
|
$params['source_shop'] = $sources[$params['source']] ?? null;
|
||||||
$params['item_title'] = $this->findElementByValue($this->itemsformattedTree,$params['item_id'] ?? null);
|
$params['item_title'] = $this->findElementByValue($this->itemsformattedTree, $params['item_id'] ?? null);
|
||||||
// $params['create_time'] = date('Y-m-d H:i:s');
|
// $params['create_time'] = date('Y-m-d H:i:s');
|
||||||
$params['update_time'] = date('Y-m-d H:i:s');
|
$params['update_time'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
|
@ -396,8 +395,8 @@ class Order extends Backend
|
||||||
|
|
||||||
//日志
|
//日志
|
||||||
$hookParams = [
|
$hookParams = [
|
||||||
'dispatch' => (new OrderDispatch())->where('id', $res)->find(),
|
'dispatch' => (new OrderDispatch())->where('id', $res)->find(),
|
||||||
'remark' => '自动派单,操作人:'.$this->auth->nickname,
|
'remark' => '自动派单,操作人:' . $this->auth->nickname,
|
||||||
];
|
];
|
||||||
Hook::listen('order_dispatch_change', $hookParams);
|
Hook::listen('order_dispatch_change', $hookParams);
|
||||||
|
|
||||||
|
|
@ -417,19 +416,19 @@ class Order extends Backend
|
||||||
|
|
||||||
$order = $this->model->where('id', $ids)->find();
|
$order = $this->model->where('id', $ids)->find();
|
||||||
|
|
||||||
$area_id = substr($order->area_id,0,4);
|
$area_id = substr($order->area_id, 0, 4);
|
||||||
|
|
||||||
$res = Admin::where('area_ids','like','%'.$area_id.'%')
|
$res = Admin::where('area_ids', 'like', '%' . $area_id . '%')
|
||||||
->column('id');
|
->column('id');
|
||||||
|
|
||||||
|
|
||||||
$insert = [];
|
$insert = [];
|
||||||
foreach ($res as $re){
|
foreach ($res as $re) {
|
||||||
$insert [] = [
|
$insert [] = [
|
||||||
'to_id' => $re,
|
'to_id' => $re,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'title' => '订单报错通知',
|
'title' => '订单报错通知',
|
||||||
'content' => '【催单通知】您有一条订单号为'.$order->order_no.'的订单被催单,请立即派单!'
|
'content' => '【催单通知】您有一条订单号为' . $order->order_no . '的订单被催单,请立即派单!'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$build = new Message();
|
$build = new Message();
|
||||||
|
|
@ -439,16 +438,63 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addAbnormal($ids = null){
|
public function warning($ids = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (false === $this->request->isPost()) {
|
||||||
|
$order = $this->model->where('id', $ids)->find();
|
||||||
|
$abnormals = model('abnormal')->where('type', 3)->order('sort', 'desc')->select();
|
||||||
|
$options = [];
|
||||||
|
foreach ($abnormals as $abnormal) {
|
||||||
|
$options [] = $abnormal->toArray();
|
||||||
|
}
|
||||||
|
return $this->fetch('warning', ['row' => $order, 'options' => $options]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$params = $this->request->post('row/a');
|
||||||
|
if (empty($params)) {
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
$params = $this->preExcludeFields($params);
|
||||||
|
|
||||||
|
$order = model('order')->get($params['order_id']);
|
||||||
|
|
||||||
|
|
||||||
|
$area_id = substr($order->area_id, 0, 4);
|
||||||
|
|
||||||
|
$res = Admin::where('area_ids', 'like', '%' . $area_id . '%')
|
||||||
|
->column('id');
|
||||||
|
$message = $params['detail'] ?? '';
|
||||||
|
|
||||||
|
|
||||||
|
$insert = [];
|
||||||
|
foreach ($res as $re) {
|
||||||
|
$insert [] = [
|
||||||
|
'to_id' => $re,
|
||||||
|
'type' => 1,
|
||||||
|
'title' => '订单内容变更',
|
||||||
|
'content' => '【订单内容变更】您有一条订单信息被修改,修改内容为:【' . $message . '】,请注意查收。'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$build = new Message();
|
||||||
|
$build->saveAll($insert);
|
||||||
|
|
||||||
|
$this->success('操作成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function addAbnormal($ids = null)
|
||||||
|
{
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
|
|
||||||
$abnormals = model('abnormal')->where('type',1)->order('sort','desc')->select();
|
$abnormals = model('abnormal')->where('type', 1)->order('sort', 'desc')->select();
|
||||||
$abnormals_data = [];
|
$abnormals_data = [];
|
||||||
foreach ($abnormals as $abnormal){
|
foreach ($abnormals as $abnormal) {
|
||||||
$abnormals_data [] = $abnormal->toArray();
|
$abnormals_data [] = $abnormal->toArray();
|
||||||
}
|
}
|
||||||
$order = model('order')->get($ids);
|
$order = model('order')->get($ids);
|
||||||
return $this->fetch('abnormal',['row' => $order,'options'=>$abnormals_data]);
|
return $this->fetch('abnormal', ['row' => $order, 'options' => $abnormals_data]);
|
||||||
}
|
}
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
|
@ -475,10 +521,10 @@ class Order extends Backend
|
||||||
];
|
];
|
||||||
|
|
||||||
Message::create([
|
Message::create([
|
||||||
'to_id' => $order->admin_id,
|
'to_id' => $order->admin_id,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'title' => '订单报错通知',
|
'title' => '订单报错通知',
|
||||||
'content' => '【订单报错通知】您有一条订单号为'.$order->order_no.'的订单订单信息录入错误,请前往报错订单界面进行查看,并立即处理!'
|
'content' => '【订单报错通知】您有一条订单号为' . $order->order_no . '的订单订单信息录入错误,请前往报错订单界面进行查看,并立即处理!'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$result = \model('order_abnormal')->insert($insert);
|
$result = \model('order_abnormal')->insert($insert);
|
||||||
|
|
@ -494,16 +540,17 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function delete($ids = null){
|
public function delete($ids = null)
|
||||||
|
{
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
|
|
||||||
$options = \model('abnormal')->where('type',2)->select();
|
$options = \model('abnormal')->where('type', 2)->select();
|
||||||
$op = [];
|
$op = [];
|
||||||
foreach ($options as $option){
|
foreach ($options as $option) {
|
||||||
$op[] = ['id' =>$option->id,'title'=>$option->title];
|
$op[] = ['id' => $option->id, 'title' => $option->title];
|
||||||
}
|
}
|
||||||
$order = model('order')->get($ids);
|
$order = model('order')->get($ids);
|
||||||
return $this->fetch('delete',['row' => $order,'options'=>$op]);
|
return $this->fetch('delete', ['row' => $order, 'options' => $op]);
|
||||||
}
|
}
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
|
@ -511,51 +558,62 @@ class Order extends Backend
|
||||||
}
|
}
|
||||||
$params = $this->preExcludeFields($params);
|
$params = $this->preExcludeFields($params);
|
||||||
|
|
||||||
|
$send_mail = $params['notify'] ?? false;
|
||||||
|
|
||||||
$result = false;
|
$result = false;
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
|
$order = model('order')->get($params['order_id'], ['dispatch']);
|
||||||
|
if (!$order) {
|
||||||
|
$this->error('Not Find');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$order = model('order')->get($params['order_id'],['dispatch']);
|
|
||||||
if (!$order){
|
|
||||||
$this->error('Not Find');
|
|
||||||
}
|
|
||||||
$params['status'] = \app\admin\model\Order::STATUS_CANCEL;
|
$params['status'] = \app\admin\model\Order::STATUS_CANCEL;
|
||||||
|
|
||||||
|
unset($params['notify']);
|
||||||
|
|
||||||
$result = $order->allowField(true)->save($params);
|
$result = $order->allowField(true)->save($params);
|
||||||
|
|
||||||
if(!empty($order->dispatch)){
|
if (!empty($order->dispatch->id)) {
|
||||||
$orderLogic = new OrderLogic();
|
$orderLogic = new OrderLogic();
|
||||||
$orderLogic->cancelOrderDispatch($order->dispatch,$this->auth,'订单被取消',false);
|
$orderLogic->cancelOrderDispatch($order->dispatch, $this->auth, '订单被取消', false);
|
||||||
|
//日志
|
||||||
|
$hookparams['order'] = $order;
|
||||||
|
$hookparams['role'] = 1;
|
||||||
|
$hookparams['auth'] = $this->auth;
|
||||||
|
$hookparams['remark'] = $params['remark'] ?? '';
|
||||||
|
Hook::listen('order_change', $hookparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
//日志
|
|
||||||
$hookparams['order'] = $order;
|
|
||||||
$hookparams['role'] = 1;
|
|
||||||
$hookparams['auth'] = $this->auth;
|
|
||||||
$hookparams['remark'] = $params['remark']??'';
|
|
||||||
Hook::listen('order_change', $hookparams);
|
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
$this->error(__('No rows were inserted'));
|
$this->error(__('No rows were inserted'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($send_mail) {
|
||||||
|
SendMailLogic::sendToCustomStop($order->tel);
|
||||||
|
}
|
||||||
|
|
||||||
$this->success();
|
$this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function send($ids = null){
|
public function send($ids = null)
|
||||||
|
{
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
|
|
||||||
$options = \model('admin')->select();
|
$options = \model('admin')->select();
|
||||||
$op = [];
|
$op = [];
|
||||||
foreach ($options as $option){
|
foreach ($options as $option) {
|
||||||
$op[] = ['id' =>$option->id,'title'=>$option->nickname];
|
$op[] = ['id' => $option->id, 'title' => $option->nickname];
|
||||||
}
|
}
|
||||||
$order = model('order')->get($ids);
|
$order = model('order')->get($ids);
|
||||||
return $this->fetch('delete',['row' => $order,'options'=>$op]);
|
return $this->fetch('delete', ['row' => $order, 'options' => $op]);
|
||||||
}
|
}
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
|
@ -568,7 +626,7 @@ class Order extends Backend
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$order = model('order')->get($params['order_id']);
|
$order = model('order')->get($params['order_id']);
|
||||||
if (!$order){
|
if (!$order) {
|
||||||
$this->error('Not Find');
|
$this->error('Not Find');
|
||||||
}
|
}
|
||||||
$params['status'] = \app\admin\model\Order::STATUS_CANCEL;
|
$params['status'] = \app\admin\model\Order::STATUS_CANCEL;
|
||||||
|
|
@ -614,6 +672,7 @@ class Order extends Backend
|
||||||
// 重新索引数组
|
// 重新索引数组
|
||||||
return array_values($filtered_codes);
|
return array_values($filtered_codes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
|
|
@ -622,10 +681,11 @@ class Order extends Backend
|
||||||
* @throws DbException
|
* @throws DbException
|
||||||
* @throws \think\Exception
|
* @throws \think\Exception
|
||||||
*/
|
*/
|
||||||
public function invoice($ids = null){
|
public function invoice($ids = null)
|
||||||
|
{
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
$order = model('order')->get($ids);
|
$order = model('order')->get($ids);
|
||||||
return $this->fetch('order/invoice/add',['row' => $order]);
|
return $this->fetch('order/invoice/add', ['row' => $order]);
|
||||||
}
|
}
|
||||||
$params = $this->request->post('row/a');
|
$params = $this->request->post('row/a');
|
||||||
if (empty($params)) {
|
if (empty($params)) {
|
||||||
|
|
@ -642,7 +702,7 @@ class Order extends Backend
|
||||||
$params['invoice_method'] = 1;
|
$params['invoice_method'] = 1;
|
||||||
$result = (new Invoice())->allowField(true)->save($params);
|
$result = (new Invoice())->allowField(true)->save($params);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -652,7 +712,8 @@ class Order extends Backend
|
||||||
$this->success();
|
$this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
function findElementByValue($data, $targetValue, $path = []) {
|
function findElementByValue($data, $targetValue, $path = [])
|
||||||
|
{
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
// 将当前节点的 label 添加到路径中
|
// 将当前节点的 label 添加到路径中
|
||||||
$newPath = array_merge($path, [$item['label']]);
|
$newPath = array_merge($path, [$item['label']]);
|
||||||
|
|
|
||||||
73
application/admin/controller/SendMailLogic.php
Normal file
73
application/admin/controller/SendMailLogic.php
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
|
||||||
|
class SendMailLogic
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给工人发送开始前短信
|
||||||
|
* @param $tel
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function sendToWorker($toTel)
|
||||||
|
{
|
||||||
|
$config = get_addon_config('alisms');
|
||||||
|
if (!isset($config['template']['start_worker'])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$alisms = new \addons\alisms\library\Alisms();
|
||||||
|
$result = $alisms->mobile($toTel)
|
||||||
|
->template($config['template']['start_worker'])
|
||||||
|
->param([])
|
||||||
|
->send();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给客户接单的信息
|
||||||
|
* @param $tel
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function sendToCustomStart($toTel,$work_name,$work_tel)
|
||||||
|
{
|
||||||
|
$config = get_addon_config('alisms');
|
||||||
|
if (!isset($config['template']['start_custom'])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$alisms = new \addons\alisms\library\Alisms();
|
||||||
|
$result = $alisms->mobile($toTel)
|
||||||
|
->template($config['template']['start_custom'])
|
||||||
|
->param([
|
||||||
|
'name' => $work_name,
|
||||||
|
'phone' => $work_tel
|
||||||
|
])
|
||||||
|
->send();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给客户取消订单的信息
|
||||||
|
* @param $tel
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function sendToCustomStop($toTel)
|
||||||
|
{
|
||||||
|
$config = get_addon_config('alisms');
|
||||||
|
if (!isset($config['template']['stop_custom'])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$alisms = new \addons\alisms\library\Alisms();
|
||||||
|
$result = $alisms->mobile($toTel)
|
||||||
|
->template($config['template']['stop_custom'])
|
||||||
|
->param()
|
||||||
|
->send();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -175,12 +175,13 @@ class Aftersale extends Backend
|
||||||
Message::create([
|
Message::create([
|
||||||
'to_id' => $params['dispatch_admin_id'],
|
'to_id' => $params['dispatch_admin_id'],
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'title' => '订单报错通知',
|
'title' => '售后申请通知',
|
||||||
'content' => '【售后申请通知】您有一条售后申请待处理,请前往订单售后界面进行处理!'
|
'content' => '【售后申请通知】您有一条售后申请待处理,请前往订单售后界面进行处理!'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
$order->aftersale_id = $this->model->id;
|
$order->aftersale_id = $this->model->id;
|
||||||
|
$order->status = Order::STATUS_AFTERSALE;
|
||||||
$order->save();
|
$order->save();
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ return [
|
||||||
'Status 50' => '待结算',
|
'Status 50' => '待结算',
|
||||||
'Set status to 50' => '设为待结算',
|
'Set status to 50' => '设为待结算',
|
||||||
'Status 60' => '已完成',
|
'Status 60' => '已完成',
|
||||||
|
'Status 70' => '售后',
|
||||||
'Set status to 60' => '设为已完成',
|
'Set status to 60' => '设为已完成',
|
||||||
'Status -10' => '取消',
|
'Status -10' => '取消',
|
||||||
'Set status to -10' => '设为取消',
|
'Set status to -10' => '设为取消',
|
||||||
|
|
|
||||||
|
|
@ -55,18 +55,23 @@ class Order extends Model
|
||||||
const STATUS_CHECKONCE = 41; //审核未通过
|
const STATUS_CHECKONCE = 41; //审核未通过
|
||||||
const STATUS_AUDITING = 50; //审核中
|
const STATUS_AUDITING = 50; //审核中
|
||||||
const STATUS_FINISHED = 60; //已完成
|
const STATUS_FINISHED = 60; //已完成
|
||||||
|
const STATUS_AFTERSALE= 70; //已完成
|
||||||
const STATUS_CANCEL = -10; //取消
|
const STATUS_CANCEL = -10; //取消
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getStatusList()
|
public function getStatusList()
|
||||||
{
|
{
|
||||||
return ['0' => __('Status 0'),'10' => __('Status 10'), '20' => __('Status 20'),
|
return ['0' => __('Status 0'),'10' => __('Status 10'), '20' => __('Status 20'),
|
||||||
//'30' => __('Status 30'),
|
//'30' => __('Status 30'),
|
||||||
'40' => __('Status 40'),
|
'40' => __('Status 40'),
|
||||||
'41' => __('Status 41'),
|
'41' => __('Status 41'),
|
||||||
'50' => __('Status 50'), '60' => __('Status 60'), '-10' => __('Status -10')];
|
'50' => __('Status 50'),
|
||||||
|
'60' => __('Status 60'),
|
||||||
|
'70' => __('Status 70'),
|
||||||
|
'-10' => __('Status -10')];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -186,6 +191,11 @@ class Order extends Model
|
||||||
return $this->belongsTo(Admin::class,'admin_id',);
|
return $this->belongsTo(Admin::class,'admin_id',);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function admin(){
|
||||||
|
return $this->belongsTo(Admin::class,'admin_id',joinType: 'left')
|
||||||
|
->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
public function item(){
|
public function item(){
|
||||||
return $this->belongsTo(Item::class,'item_id',);
|
return $this->belongsTo(Item::class,'item_id',);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">异常类型:</label>
|
<label class="control-label col-xs-12 col-sm-2">报错类型:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
<select id="c-coupon" data-live-search="true" title="请选择" data-rule="required" name="row[abnormal_id]" class="form-control">
|
<select id="c-coupon" data-live-search="true" title="请选择" data-rule="required" name="row[abnormal_id]" class="form-control">
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">异常类型:</label>
|
<label class="control-label col-xs-12 col-sm-2">紧急程度:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
<select data-live-search="true" title="请选择" data-rule="required" name="row[level]" class="form-control">
|
<select data-live-search="true" title="请选择" data-rule="required" name="row[level]" class="form-control">
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">异常详情:</label>
|
<label class="control-label col-xs-12 col-sm-2">报错详情:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-detail" data-rule="required" class="form-control" rows="5" name="row[detail]" cols="50"></textarea>
|
<textarea id="c-detail" data-rule="required" class="form-control" rows="5" name="row[detail]" cols="50"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">短信通知客户: <input type="checkbox" name="row[notify]"> </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
|
||||||
41
application/admin/view/order/warning.html
Normal file
41
application/admin/view/order/warning.html
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('order/warning')}">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">订单编号</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-order_id"
|
||||||
|
disabled
|
||||||
|
class="form-control" type="text" value="{$row->order_no}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" name="row[order_id]" value="{$row->id}" >
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">异常类型:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-coupon" data-live-search="true" title="请选择" data-rule="required" name="row[abnormal_id]" class="form-control">
|
||||||
|
{foreach $options as $item}
|
||||||
|
<option value="{$item['id']}">{$item['title']}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">异常详情:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-detail" data-rule="required" class="form-control" rows="5" name="row[detail]" cols="50"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
{:build_heading()}
|
{:build_heading()}
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<ul class="nav nav-tabs" data-field="type">
|
<ul class="nav nav-tabs" data-field="type">
|
||||||
<li class="{:$Think.get.type === (string)1 ? 'active' : ''}"><a href="#t-1" data-value="1" data-toggle="tab">订单异常类型</a></li>
|
<li class="{:$Think.get.type === (string)1 ? 'active' : ''}"><a href="#t-1" data-value="1" data-toggle="tab">订单报错类型</a></li>
|
||||||
<li class="{:$Think.get.type === (string)2 ? 'active' : ''}"><a href="#t-2" data-value="2" data-toggle="tab">订单取消类型</a></li>
|
<li class="{:$Think.get.type === (string)2 ? 'active' : ''}"><a href="#t-2" data-value="2" data-toggle="tab">订单取消类型</a></li>
|
||||||
<li class="{:$Think.get.type === (string)2 ? 'active' : ''}"><a href="#t-3" data-value="3" data-toggle="tab">订单报错类型</a></li>
|
<li class="{:$Think.get.type === (string)2 ? 'active' : ''}"><a href="#t-3" data-value="3" data-toggle="tab">订单异常类型</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
define([], function () {
|
define([], function () {
|
||||||
require([], function () {
|
require([], function () {
|
||||||
//绑定data-toggle=addresspicker属性点击事件
|
//绑定data-toggle=addresspicker属性点击事件
|
||||||
|
console.log('111');
|
||||||
|
|
||||||
$(document).on('click', "[data-toggle='addresspicker']", function () {
|
$(document).on('click', "[data-toggle='addresspicker']", function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
var callback = $(that).data('callback');
|
var callback = $(that).data('callback');
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
"41": __('Status 41'),
|
"41": __('Status 41'),
|
||||||
"50": __('Status 50'),
|
"50": __('Status 50'),
|
||||||
"60": __('Status 60'),
|
"60": __('Status 60'),
|
||||||
|
"70": __('Status 70'),
|
||||||
"-10": __('Status -10'),
|
"-10": __('Status -10'),
|
||||||
/*"-20": __('Status -20'),
|
/*"-20": __('Status -20'),
|
||||||
"-30": __('Status -30')*/
|
"-30": __('Status -30')*/
|
||||||
|
|
@ -199,7 +200,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
extend: 'data-toggle="tooltip" data-container="body"',
|
extend: 'data-toggle="tooltip" data-container="body"',
|
||||||
classname: 'btn btn-xs btn-info btn-editone',
|
classname: 'btn btn-xs btn-info btn-editone',
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status != 60) {
|
if (row.status != 60 && row.status != 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -237,6 +238,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
},
|
},
|
||||||
refresh: true,
|
refresh: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "warning",
|
||||||
|
text: "发起异常",
|
||||||
|
title: "发起异常",
|
||||||
|
extend: 'data-toggle="tooltip" data-container="body"',
|
||||||
|
classname: 'btn btn-xs btn-dialog',
|
||||||
|
icon: 'fa fa-add',
|
||||||
|
url: 'order/warning',
|
||||||
|
visible: function (row) {
|
||||||
|
if (row.status == 10) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
dropdown: "更多",
|
||||||
|
refresh: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "mapdispatch",
|
name: "mapdispatch",
|
||||||
text: "地图派单",
|
text: "地图派单",
|
||||||
|
|
@ -277,12 +296,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
//return false;
|
//return false;
|
||||||
},
|
},
|
||||||
error: function (data, ret) {
|
error: function (data, ret) {
|
||||||
console.log(data, ret);
|
|
||||||
Layer.alert(ret.msg);
|
Layer.alert(ret.msg);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status > 0) {
|
if (row.status == 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -325,7 +343,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
refresh:true,
|
refresh:true,
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status != 60) {
|
if (row.status != 60 && row.status != 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -341,7 +359,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
|
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status == 60) {
|
if (row.status == 60 || row.status == 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -356,7 +374,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
url: 'aftersales/aftersale/add',
|
url: 'aftersales/aftersale/add',
|
||||||
dropdown: "更多",
|
dropdown: "更多",
|
||||||
visible: function (row) {
|
visible: function (row) {
|
||||||
if (row.status!==-10) {
|
if (row.status !== -10 && row.status !== 70) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -473,6 +491,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function
|
||||||
addabnormal: function () {
|
addabnormal: function () {
|
||||||
Form.api.bindevent($("#add-form"));
|
Form.api.bindevent($("#add-form"));
|
||||||
},
|
},
|
||||||
|
warning: function () {
|
||||||
|
Form.api.bindevent($("#add-form"));
|
||||||
|
},
|
||||||
delete: function () {
|
delete: function () {
|
||||||
Form.api.bindevent($("form[role=form]"));
|
Form.api.bindevent($("form[role=form]"));
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
buttons:[
|
buttons:[
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
text: "修改",
|
text: "开票",
|
||||||
icon: 'fa fa-pencil',
|
icon: 'fa fa-pencil',
|
||||||
title: __('Edit'),
|
title: __('Edit'),
|
||||||
extend: 'data-toggle="tooltip" data-container="body"',
|
extend: 'data-toggle="tooltip" data-container="body"',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user