diff --git a/addons/alisms/config.php b/addons/alisms/config.php index 541978f..edc55f6 100644 --- a/addons/alisms/config.php +++ b/addons/alisms/config.php @@ -2,72 +2,67 @@ return [ [ - 'name' => 'key', - 'title' => '应用key', - 'type' => 'string', + 'name' => 'key', + 'title' => '应用key', + 'type' => 'string', 'content' => [], - 'value' => 'your key', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'LTAI5t87F5mAkaXVKfLcmnrB', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'secret', - 'title' => '密钥secret', - 'type' => 'string', + 'name' => 'secret', + 'title' => '密钥secret', + 'type' => 'string', 'content' => [], - 'value' => 'your secret', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'fk7KgdqRdJUS6Jc99TlB6mNLKorrsD', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'sign', - 'title' => '签名', - 'type' => 'string', + 'name' => 'sign', + 'title' => '签名', + 'type' => 'string', 'content' => [], - 'value' => 'your sign', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '超邦手', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'template', - 'title' => '短信模板', - 'type' => 'array', + 'name' => 'template', + 'title' => '短信模板', + 'type' => 'array', 'content' => [], - 'value' => [ - 'register' => 'SMS_114000000', - 'resetpwd' => 'SMS_114000000', - 'changepwd' => 'SMS_114000000', - 'changemobile' => 'SMS_114000000', - 'profile' => 'SMS_114000000', - 'notice' => 'SMS_114000000', - 'mobilelogin' => 'SMS_114000000', - 'bind' => 'SMS_114000000', + 'value' => [ + 'stop_custom' => 'SMS_487200413', + 'start_custom' => 'SMS_487260356', + 'start_worker' => 'SMS_487375365', ], - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => '__tips__', - 'title' => '温馨提示', - 'type' => 'string', + 'name' => '__tips__', + 'title' => '温馨提示', + 'type' => 'string', 'content' => [], - 'value' => '应用key和密钥你可以通过 https://ak-console.aliyun.com/?spm=a2c4g.11186623.2.13.fd315777PX3tjy#/accesskey 获取', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '应用key和密钥你可以通过 https://ak-console.aliyun.com/?spm=a2c4g.11186623.2.13.fd315777PX3tjy#/accesskey 获取', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], ]; diff --git a/addons/alisms/info.ini b/addons/alisms/info.ini index 1fb99d5..64ee2e7 100644 --- a/addons/alisms/info.ini +++ b/addons/alisms/info.ini @@ -5,6 +5,6 @@ author = FastAdmin website = https://www.fastadmin.net version = 1.0.10 state = 1 -url = http://fast.cc:8088/addons/alisms +url = http://127.0.0.1:8088/addons/alisms license = regular licenseto = 15976 diff --git a/application/admin/command/Test.php b/application/admin/command/Test.php index dabed0b..dd5210e 100644 --- a/application/admin/command/Test.php +++ b/application/admin/command/Test.php @@ -31,9 +31,17 @@ class Test extends Command protected function execute(Input $input, Output $output) { - $order = (new Order())->find(110); - $id = (new DispatchLogic())->getMaxScoreWorker($order); - dd($id); + $res = \app\common\library\Sms::notice('17381847364',[], 'start_worker'); + + $alisms = new \addons\alisms\library\Alisms(); + $ret = $alisms->mobile('13038128325') + ->template('SMS_487375365') + ->sign('超邦手') + ->send(); + + dd($ret); + + } diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index fd62e5c..fc005ca 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -439,6 +439,52 @@ class Order extends Backend } + 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()) { diff --git a/application/admin/view/order/abnormal.html b/application/admin/view/order/abnormal.html index 6c56b33..6274420 100644 --- a/application/admin/view/order/abnormal.html +++ b/application/admin/view/order/abnormal.html @@ -14,7 +14,7 @@
- +
@@ -38,7 +38,7 @@
- +
diff --git a/application/admin/view/order/warning.html b/application/admin/view/order/warning.html new file mode 100644 index 0000000..5bdeac0 --- /dev/null +++ b/application/admin/view/order/warning.html @@ -0,0 +1,41 @@ +
+ + +
+ +
+ +
+
+ + + + +
+ +
+ + +
+
+ +
+ +
+ +
+
+ + +
diff --git a/application/admin/view/setting/abnormal/index.html b/application/admin/view/setting/abnormal/index.html index ba71a24..be43d3b 100644 --- a/application/admin/view/setting/abnormal/index.html +++ b/application/admin/view/setting/abnormal/index.html @@ -2,9 +2,9 @@ {:build_heading()}
diff --git a/public/assets/js/addons.js b/public/assets/js/addons.js index 0f3bdcb..844ff8c 100755 --- a/public/assets/js/addons.js +++ b/public/assets/js/addons.js @@ -1,6 +1,8 @@ define([], function () { require([], function () { //绑定data-toggle=addresspicker属性点击事件 + console.log('111'); + $(document).on('click', "[data-toggle='addresspicker']", function () { var that = this; var callback = $(that).data('callback'); diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index 0be2471..6fbc018 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -237,6 +237,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function }, 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", text: "地图派单", @@ -277,7 +295,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function //return false; }, error: function (data, ret) { - console.log(data, ret); Layer.alert(ret.msg); return false; }, @@ -473,6 +490,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function addabnormal: function () { Form.api.bindevent($("#add-form")); }, + warning: function () { + Form.api.bindevent($("#add-form")); + }, delete: function () { Form.api.bindevent($("form[role=form]")); },