forked from qmpaas/leadshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增:悬浮窗 优化:编辑商品的规格值数量限制问题 修复:公众号商城的商品海报二维码无法访问 修复:商品采集的草稿箱数据问题 修复:优惠券发放总量为1时的判断问题
- Loading branch information
wj005
committed
Aug 23, 2021
1 parent
b72fcea
commit 2f45958
Showing
275 changed files
with
4,053 additions
and
4,059 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<?php | ||
/** | ||
* 地址管理 | ||
* @link http://www.heshop.com/ | ||
* @copyright Copyright (c) 2020 HeShop Software LLC | ||
* @license http://www.heshop.com/license/ | ||
*/ | ||
namespace leadmall\api; | ||
|
||
use leadmall\Map; | ||
use setting\api\AddressController as AddressModules; | ||
|
||
class AddressController extends AddressModules implements Map | ||
{ | ||
|
||
} | ||
<?php | ||
/** | ||
* 地址管理 | ||
* @link https://www.leadshop.vip/ | ||
* @copyright Copyright ©2020-2021 浙江禾成云计算有限公司 | ||
*/ | ||
|
||
namespace leadmall\api; | ||
|
||
use leadmall\Map; | ||
use setting\api\AddressController as AddressModules; | ||
|
||
class AddressController extends AddressModules implements Map | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,138 +1,138 @@ | ||
<?php | ||
/** | ||
* 应用管理 | ||
* @link http://www.heshop.com/ | ||
* @copyright Copyright (c) 2020 HeShop Software LLC | ||
* @license http://www.heshop.com/license/ | ||
*/ | ||
namespace leadmall\api; | ||
|
||
use basics\api\BasicsController as BasicsModules; | ||
use framework\wechat\WechatAccesstoken; | ||
use leadmall\Map; | ||
use Yii; | ||
|
||
class AppconfigController extends BasicsModules implements Map | ||
{ | ||
|
||
/** | ||
* 重写父类 | ||
* @return [type] [description] | ||
*/ | ||
public function actions() | ||
{ | ||
$actions = parent::actions(); | ||
unset($actions['create']); | ||
unset($actions['update']); | ||
return $actions; | ||
} | ||
|
||
public function actionIndex() | ||
{ | ||
$url = Yii::$app->basePath . '/stores/' . Yii::$app->params['AppID'] . '.json'; | ||
if (file_exists($url)) { | ||
$json = file_get_contents($url); | ||
$arr = to_array($json); | ||
$arr['apply']['wechat']['url'] = Yii::$app->request->hostInfo; | ||
$arr['apply']['wechat']['token'] = $arr['apply']['wechat']['token'] ? $arr['apply']['wechat']['token'] : get_random(6); | ||
$arr['apply']['wechat']['encodingAesKey'] = $arr['apply']['wechat']['encodingAesKey'] ? $arr['apply']['wechat']['token'] : get_random(43); | ||
return $arr; | ||
} else { | ||
Error('文件不存在'); | ||
} | ||
} | ||
|
||
public function actionCreate() | ||
{ | ||
//获取操作 | ||
$behavior = Yii::$app->request->get('behavior', ''); | ||
switch ($behavior) { | ||
case 'upload': | ||
return $this->upload(); | ||
break; | ||
case 'save': | ||
return $this->save(); | ||
break; | ||
default: | ||
return 111222; | ||
break; | ||
} | ||
|
||
} | ||
|
||
public function save() | ||
{ | ||
$post = Yii::$app->request->post(); | ||
$key = Yii::$app->request->get('key', ''); | ||
if (empty($post)) { | ||
Error('数据为空'); | ||
} | ||
$url = Yii::$app->basePath . '/stores/' . Yii::$app->params['AppID'] . '.json'; | ||
if (file_exists($url)) { | ||
$json = file_get_contents($url); | ||
$data = to_array($json); | ||
$key = explode('_', $key); | ||
if (isset($data[$key[0]][$key[1]])) { | ||
$data[$key[0]][$key[1]] = $post; | ||
} else { | ||
Error('配置不存在'); | ||
} | ||
$data = to_json($data); | ||
if ($key[0] == 'apply') { | ||
$this->check($key[1]); | ||
} | ||
return to_mkdir($url, $data, true, true); | ||
} else { | ||
Error('文件不存在'); | ||
} | ||
} | ||
|
||
private function check($type) | ||
{ | ||
$platform = '微信小程序'; | ||
if ($type == 'wechat') { | ||
$platform = '微信公众号'; | ||
} | ||
$appId = Yii::$app->request->post('AppID', false); | ||
$appSecret = Yii::$app->request->post('AppSecret', false); | ||
if (!$appId) { | ||
throw new \Exception($platform . 'AppId有误'); | ||
} | ||
if (!$appSecret) { | ||
throw new \Exception($platform . 'AppSecret有误'); | ||
} | ||
try { | ||
$weapp = new WechatAccesstoken(); | ||
$weapp->resetAuth($appId); | ||
$weapp->getAccessToken($appId, $appSecret); | ||
} catch (\Exception $exception) { | ||
if (isset($weapp->errCode) && isset($weapp->errMsg)) { | ||
if ($weapp->errCode == '40013') { | ||
Error($platform . 'AppId有误(' . $weapp->errMsg . ')'); | ||
} | ||
if ($weapp->errCode == '40125') { | ||
Error($platform . 'appSecret有误(' . $weapp->errMsg . ')'); | ||
} | ||
} | ||
Error($platform . $exception->getMessage()); | ||
} | ||
return true; | ||
} | ||
|
||
public function upload() | ||
{ | ||
$file = $_FILES['file']; | ||
preg_match('|\.(\w+)$|', $file['name'], $ext); | ||
$ext = strtolower($ext[1]); | ||
if (!in_array($ext, ['txt','ico'])) { | ||
Error('不被允许的文件类型'); | ||
} | ||
if (move_uploaded_file($file['tmp_name'], Yii::$app->basePath . '/web/' . $file['name'])) { | ||
$url = Yii::$app->request->hostInfo; | ||
return $url . '/' . $file['name']; | ||
} else { | ||
Error('上传失败'); | ||
} | ||
} | ||
|
||
} | ||
<?php | ||
/** | ||
* 应用管理 | ||
* @link https://www.leadshop.vip/ | ||
* @copyright Copyright ©2020-2021 浙江禾成云计算有限公司 | ||
*/ | ||
|
||
namespace leadmall\api; | ||
|
||
use basics\api\BasicsController as BasicsModules; | ||
use framework\wechat\WechatAccesstoken; | ||
use leadmall\Map; | ||
use Yii; | ||
|
||
class AppconfigController extends BasicsModules implements Map | ||
{ | ||
|
||
/** | ||
* 重写父类 | ||
* @return [type] [description] | ||
*/ | ||
public function actions() | ||
{ | ||
$actions = parent::actions(); | ||
unset($actions['create']); | ||
unset($actions['update']); | ||
return $actions; | ||
} | ||
|
||
public function actionIndex() | ||
{ | ||
$url = Yii::$app->basePath . '/stores/' . Yii::$app->params['AppID'] . '.json'; | ||
if (file_exists($url)) { | ||
$json = file_get_contents($url); | ||
$arr = to_array($json); | ||
$arr['apply']['wechat']['url'] = Yii::$app->request->hostInfo; | ||
$arr['apply']['wechat']['token'] = $arr['apply']['wechat']['token'] ? $arr['apply']['wechat']['token'] : get_random(6); | ||
$arr['apply']['wechat']['encodingAesKey'] = $arr['apply']['wechat']['encodingAesKey'] ? $arr['apply']['wechat']['token'] : get_random(43); | ||
return $arr; | ||
} else { | ||
Error('文件不存在'); | ||
} | ||
} | ||
|
||
public function actionCreate() | ||
{ | ||
//获取操作 | ||
$behavior = Yii::$app->request->get('behavior', ''); | ||
switch ($behavior) { | ||
case 'upload': | ||
return $this->upload(); | ||
break; | ||
case 'save': | ||
return $this->save(); | ||
break; | ||
default: | ||
return 111222; | ||
break; | ||
} | ||
|
||
} | ||
|
||
public function save() | ||
{ | ||
$post = Yii::$app->request->post(); | ||
$key = Yii::$app->request->get('key', ''); | ||
if (empty($post)) { | ||
Error('数据为空'); | ||
} | ||
$url = Yii::$app->basePath . '/stores/' . Yii::$app->params['AppID'] . '.json'; | ||
if (file_exists($url)) { | ||
$json = file_get_contents($url); | ||
$data = to_array($json); | ||
$key = explode('_', $key); | ||
if (isset($data[$key[0]][$key[1]])) { | ||
$data[$key[0]][$key[1]] = $post; | ||
} else { | ||
Error('配置不存在'); | ||
} | ||
$data = to_json($data); | ||
if ($key[0] == 'apply') { | ||
$this->check($key[1]); | ||
} | ||
return to_mkdir($url, $data, true, true); | ||
} else { | ||
Error('文件不存在'); | ||
} | ||
} | ||
|
||
private function check($type) | ||
{ | ||
$platform = '微信小程序'; | ||
if ($type == 'wechat') { | ||
$platform = '微信公众号'; | ||
} | ||
$appId = Yii::$app->request->post('AppID', false); | ||
$appSecret = Yii::$app->request->post('AppSecret', false); | ||
if (!$appId) { | ||
throw new \Exception($platform . 'AppId有误'); | ||
} | ||
if (!$appSecret) { | ||
throw new \Exception($platform . 'AppSecret有误'); | ||
} | ||
try { | ||
$weapp = new WechatAccesstoken(); | ||
$weapp->resetAuth($appId); | ||
$weapp->getAccessToken($appId, $appSecret); | ||
} catch (\Exception $exception) { | ||
if (isset($weapp->errCode) && isset($weapp->errMsg)) { | ||
if ($weapp->errCode == '40013') { | ||
Error($platform . 'AppId有误(' . $weapp->errMsg . ')'); | ||
} | ||
if ($weapp->errCode == '40125') { | ||
Error($platform . 'appSecret有误(' . $weapp->errMsg . ')'); | ||
} | ||
} | ||
Error($platform . $exception->getMessage()); | ||
} | ||
return true; | ||
} | ||
|
||
public function upload() | ||
{ | ||
$file = $_FILES['file']; | ||
preg_match('|\.(\w+)$|', $file['name'], $ext); | ||
$ext = strtolower($ext[1]); | ||
if (!in_array($ext, ['txt','ico'])) { | ||
Error('不被允许的文件类型'); | ||
} | ||
if (move_uploaded_file($file['tmp_name'], Yii::$app->basePath . '/web/' . $file['name'])) { | ||
$url = Yii::$app->request->hostInfo; | ||
return $url . '/' . $file['name']; | ||
} else { | ||
Error('上传失败'); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.