diff --git a/app/admin/controller/shop/LocalStore.php b/app/admin/controller/shop/LocalStore.php index 3ac0dad8..086b5cb3 100644 --- a/app/admin/controller/shop/LocalStore.php +++ b/app/admin/controller/shop/LocalStore.php @@ -7,9 +7,9 @@ use app\common\server\ConfigServer; use app\common\enum\LocalLifeICBCEnum; use app\admin\logic\shop\LocalStoreLogic; use app\common\server\JsonServer; -use app\shop\logic\order\InvoiceLogic; use think\facade\Request; + class LocalStore extends AdminBase { public function lists() @@ -47,23 +47,6 @@ class LocalStore extends AdminBase ]); } - /** - * @notes 删除本地生活 - */ - public function del() - { - if ($this->request->isAjax()) { - $id = $this->request->post('id'); - try { - if (LocalStoreLogic::del_data($id)) { - return JsonServer::success('操作成功'); - } - } catch (\Exception $e) { - return JsonServer::error('操作失败'); - } - } - } - /** * @notes 审核操作 */ @@ -74,10 +57,11 @@ class LocalStore extends AdminBase if (in_array($post['state'], LocalStoreLogic::$STATE_ENUM)) { if ($post['state'] == 1) { $data = LocalStoreLogic::get_data($post['id']); - Request::post('https://dlh.hainings.com/shop/abutment/test', [ + $result = Request::post('https://dlh.hainings.com/shop/abutment.abutment/test', [ 'empowerPhone' => $data['empowerPhone'], 'crftNo1' => $data['crftNo1'] ]); + } if (LocalStoreLogic::update_state($post['id'], $post['state'])) { return JsonServer::success('操作成功'); @@ -105,4 +89,20 @@ class LocalStore extends AdminBase } return JsonServer::success('', $result); } + + public function downloadErCode() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + if ($post['lstore_id'] > 0){ + $result = LocalStoreLogic::getPayImage($post['lstore_id']); + if ($result['pay_image']) { + $path = parse_url($result['pay_image'])['path']; + $url = (string)url("index/download/downloadLocalStoreErcodeImage", ['url' => $path], false, true); + return JsonServer::success('', ['url' => $url]); + } + return JsonServer::error('下载失败'); + } + } + } } \ No newline at end of file diff --git a/app/admin/logic/shop/LocalStoreLogic.php b/app/admin/logic/shop/LocalStoreLogic.php index 08d72cec..5d9f86d7 100644 --- a/app/admin/logic/shop/LocalStoreLogic.php +++ b/app/admin/logic/shop/LocalStoreLogic.php @@ -17,7 +17,7 @@ class LocalStoreLogic extends Logic public static function lists() { return array( - 'lists' => LocalStore::where(['del' => 0])->with('info')->select()->toArray() + 'lists' => LocalStore::with('info')->select()->toArray() ); } @@ -31,19 +31,7 @@ class LocalStoreLogic extends Logic return LocalStore::where(['lstore_id' => $id])->update(['store_state' => $state]); } - /** - * @notes 删除本地商家数据 - */ - public static function del_data($id) { - return LocalStore::where(['lstore_id' => $id, 'del' => 0])->update([ - 'del' => 1, - 'del_time' => date('Y-m-d H:i:s') - ]); - } - - /** - * @notes 获取未审核数据 - */ + // 获取未审核数据 public static function get_unaudited_data() { return LocalStore::where(['store_state' => 0])->count(); @@ -100,4 +88,9 @@ class LocalStoreLogic extends Logic return false; } } + + public static function getPayImage($lstore_id) + { + return LocalStore::where('lstore_id', $lstore_id)->field('pay_image')->find()->toArray(); + } } \ No newline at end of file diff --git a/app/admin/view/shop/local_store/order.html b/app/admin/view/shop/local_store/order.html index 7b2c6cec..6f6bd908 100644 --- a/app/admin/view/shop/local_store/order.html +++ b/app/admin/view/shop/local_store/order.html @@ -26,9 +26,8 @@