Skip to content

Commit

Permalink
V1.2.7
Browse files Browse the repository at this point in the history
新增:手机端开屏广告
新增:商品海报显示已售量
新增:ico上传和备案信息设置
新增:小程序端可更改和解绑手机号
优化:售后换货订单,商家发货后可更改物流信息
优化:手机端规格图片滑至即选中
优化:素材图片上传,保留原素材名称
优化:店铺装修新手指引,点击蒙层即跳至下一步
优化:商品视频封面图,可调用商品主图
修复:切换购物车商品规格,价格未对应更改问题
修复:生成商品海报,预览图变形问题
修复:购物车数量角标显示问题
修复:同一个运费模板,地址能重复选择问题
  • Loading branch information
qmpaas committed Jun 17, 2021
1 parent 3e96ebb commit df84b87
Show file tree
Hide file tree
Showing 123 changed files with 1,402 additions and 170 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Linux+Nginx+PHP7.4+MySQL5.7.3以上
<a href="https://forum.leadshop.vip/thread/35" target="_blank"> **查看常见问题/安装教程** </a>

## 下期更新计划
* <a href="https://forum.leadshop.vip/thread/347" target="_blank"> **点击查看更新预告** </a>
* <a href="https://forum.leadshop.vip/thread/401" target="_blank"> **点击查看更新预告** </a>

<img border="0" src="https://leadshop-1302407761.cos.ap-shanghai.myqcloud.com/public/attachments/2021/06/08/ywuZAhdyTIXc0KFGURsjR2SSgE3acDtKKgiYHkSa.png">

Expand Down Expand Up @@ -150,6 +150,9 @@ Linux+Nginx+PHP7.4+MySQL5.7.3以上

<img border="0" src="https://leadshop-1302407761.cos.ap-shanghai.myqcloud.com/public/attachments/2021/06/03/CGAUS3jcr3K3BfQYwnzalpR6OvWkjDcrc9hC2wUy.png">

## Ladshop用户案例
<a href="https://forum.leadshop.vip/category/10?search_ids=10" target="_blank"> **点击查看更多Leadshop用户案例** </a>

## Ladshop功能简介
![展示图](https://qmxq.oss-cn-hangzhou.aliyuncs.com/readme/20210522/1.png)
![展示图](https://qmxq.oss-cn-hangzhou.aliyuncs.com/readme/20210608/2.png)
Expand Down
3 changes: 2 additions & 1 deletion api/AppconfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public function upload()
{
$file = $_FILES['file'];
if (move_uploaded_file($file['tmp_name'], Yii::$app->basePath . '/web/' . $file['name'])) {
return true;
$url = Yii::$app->request->hostInfo;
return $url.'/'.$file['name'];
} else {
Error('上传失败');
}
Expand Down
59 changes: 36 additions & 23 deletions app/PosterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ public function actionIndex()
$type = Yii::$app->request->get('type', 1);
$goods_id = Yii::$app->request->get('goods_id', false);
if ($goods_id) {
return $this->goods($type,$goods_id);
return $this->goods($type, $goods_id);
}

$coupon_id = Yii::$app->request->get('coupon_id', false);
if ($coupon_id) {
return $this->coupon($type,$coupon_id);
return $this->coupon($type, $coupon_id);
}

}

public function coupon($type,$coupon_id){
$model = M('coupon','Coupon')::findOne($coupon_id);
public function coupon($type, $coupon_id)
{
$model = M('coupon', 'Coupon')::findOne($coupon_id);
$mpConfig = isset(Yii::$app->params['apply']['weapp']) ? Yii::$app->params['apply']['weapp'] : null;
if (!$mpConfig || !$mpConfig['AppID'] || !$mpConfig['AppSecret']) {
Error('渠道参数不完整。');
Expand All @@ -63,11 +64,10 @@ public function coupon($type,$coupon_id){
$model = $model->toArray();

if ($model['expire_type'] == 1) {
$time = '可用时间:领取当日起'.$model['expire_day'].'天内';
$time = '可用时间:领取当日起' . $model['expire_day'] . '天内';
} else {
$time = '可用时间:'.date("Y.m.d",$model['begin_time']).' - '.date("Y.m.d",$model['end_time']);
$time = '可用时间:' . date("Y.m.d", $model['begin_time']) . ' - ' . date("Y.m.d", $model['end_time']);
}


//图片转换
$config = array(
Expand Down Expand Up @@ -103,8 +103,8 @@ public function coupon($type,$coupon_id){
'lineation' => 0,
),
array(
'text' => $model['min_price']*1>0?''.$model['min_price'].'可用':'无门槛',
'left' => 168+(mb_strlen($model['sub_price']) * 28),
'text' => $model['min_price'] * 1 > 0 ? '' . $model['min_price'] . '可用' : '无门槛',
'left' => 168 + (mb_strlen($model['sub_price']) * 28),
'top' => 265,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 22, //字号
Expand Down Expand Up @@ -143,8 +143,8 @@ public function coupon($type,$coupon_id){
'lineation' => 0,
),
array(
'text' => $type == 1 ?'长按识别二维码':'长按识别小程序码',
'left' => $type == 1?305:295,
'text' => $type == 1 ? '长按识别二维码' : '长按识别小程序码',
'left' => $type == 1 ? 305 : 295,
'top' => 735,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 16, //字号
Expand Down Expand Up @@ -196,8 +196,9 @@ public function coupon($type,$coupon_id){
}
}

public function goods($type,$goods_id){
$model = M('goods', 'Goods')::find()->where(['id' => $goods_id])->one();
public function goods($type, $goods_id)
{
$model = M('goods', 'Goods')::find()->where(['id' => $goods_id])->one();

$mpConfig = isset(Yii::$app->params['apply']['weapp']) ? Yii::$app->params['apply']['weapp'] : null;
if (!$mpConfig || !$mpConfig['AppID'] || !$mpConfig['AppSecret']) {
Expand All @@ -211,10 +212,12 @@ public function goods($type,$goods_id){

if ($model) {
$model = $model->toArray();

$sales = $model['sales'] + $model['virtual_sales'];
//图片信息转换
$model = str2url($model);
//获取商品ID
$img = to_array($model['slideshow']);
$img = to_array($model['slideshow']);
//图片转换
$config = array(
'text' => array(
Expand All @@ -240,20 +243,30 @@ public function goods($type,$goods_id){
),
array(
'text' => '¥' . $model['line_price'],
'left' => 95 + (mb_strlen($model['price']) * 30),
'top' => 806,
'left' => 64,
'top' => 845,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 20, //字号
'fontColor' => '153,153,153', //字体颜色
'angle' => 0,
'lineation' => 1,
),
array(
'text' => $sales > 0 ? '已售' . $sales : '',
'left' => 64 + (mb_strlen('¥' . $model['line_price']) * 19),
'top' => 845,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 20, //字号
'fontColor' => '153,153,153', //字体颜色
'angle' => 0,
'lineation' => 0,
),
array(
'text' => mb_strlen($model['name']) > 12 ? mb_substr($model['name'], 0, 12) : $model['name'],
'left' => 64,
'top' => 860,
'top' => 885,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 24, //字号
'fontSize' => 22, //字号
'fontColor' => '0,0,0', //字体颜色
'angle' => 0,
'lineation' => 0,
Expand All @@ -262,17 +275,17 @@ public function goods($type,$goods_id){
array(
'text' => mb_strlen($model['name']) > 12 ? (mb_strlen($model['name']) > 24 ? mb_substr($model['name'], 12, 10) . "..." : mb_substr($model['name'], 12)) : "",
'left' => 64,
'top' => 903,
'top' => 923,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 24, //字号
'fontSize' => 22, //字号
'fontColor' => '0,0,0', //字体颜色
'angle' => 0,
'lineation' => 0,
),
array(
'text' => $setting_data['store_setting']['name'],
'left' => 130,
'top' => 958,
'top' => 968,
'fontPath' => realpath('../system/static/PingFang.ttf'), //字体文件
'fontSize' => 18, //字号
'fontColor' => '102,102,102', //字体颜色
Expand Down Expand Up @@ -308,7 +321,7 @@ public function goods($type,$goods_id){
array(
'url' => $setting_data['store_setting']['logo'],
'left' => 66,
'top' => 926,
'top' => 936,
'right' => 0,
'stream' => 0,
'bottom' => 0,
Expand Down
17 changes: 3 additions & 14 deletions app/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ public function actionCreate()
}

$file = $upload->image_base64($content);
$url = $file['url'];
$thumbnail = $upload->image_compress($url,1000);

if ($url !== $thumbnail) {
$path = Yii::$app->basePath;
unlink($path . '/web' . $url);
$url = $thumbnail;
}

$url = $upload::$upload_way == 0 ? Yii::$app->request->hostInfo . $file['url'] : $file['url'];
} elseif ($type == 2) {

$content = $_FILES['content'];
Expand All @@ -49,7 +41,7 @@ public function actionCreate()
}

$file = $upload->video($content);
$url = $file['url'];
$url = $upload::$upload_way == 0 ? Yii::$app->request->hostInfo . $file['url'] : $file['url'];

} else {
Error('未定义操作');
Expand All @@ -61,9 +53,6 @@ public function actionCreate()

$this->module->event->user_upload = ['url' => $file['url'], 'size' => $file['size'], 'AppID' => $AppID, 'merchant_id' => $merchant_id, 'UID' => $UID];
$this->module->trigger('user_upload');

$host = Yii::$app->request->hostInfo;
return $host . $url;

return $url;
}
}
Binary file modified applet/app.zip
Binary file not shown.
1 change: 1 addition & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"siteid": "",
"admin": "qm73x0exg9nwb1hogg",
"accessWhitelist": [
"leadmall/api/setting/update",
"leadmall/api/install/index",
"leadmall/app/poster/index",
"leadmall/api/install/create",
Expand Down
4 changes: 2 additions & 2 deletions modules/collect/models/collect/BaseCollect.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ protected function uploadFile($base64)
{
$upload = new Upload();
$file = $upload->image_base64($base64);
$url = URL_STRING . $file['url'];
$url = $upload::$upload_way == 0 ? URL_STRING . $file['url'] : $file['url'];
$thumbnail = $upload->image_compress($file['url']);
$thumbUrl = URL_STRING . $thumbnail;
$thumbUrl = $upload::$upload_way == 0 ? URL_STRING . $thumbnail : $thumbnail;
$name = explode('.', ltrim(strrchr($file['url'], '/'), '/'));
$title = $name[0];
$gallery = new Gallery();
Expand Down
5 changes: 3 additions & 2 deletions modules/gallery/api/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ public function checkAccess($operation, $params = array(), $allowCaching = true)
}
$name = Yii::$app->request->post('name', false);
if ($name) {
$type = Yii::$app->request->post('type', false);
$check = $this->modelClass::find()->where(['and', ['<>', 'id', $id], ['name' => $name, 'is_deleted' => 0, 'merchant_id' => 1, 'type' => $type, 'parent_id' => $post['parent_id']]])->exists();
$type = Yii::$app->request->post('type', false);
$parent_id = Yii::$app->request->post('parent_id', false);
$check = $this->modelClass::find()->where(['and', ['<>', 'id', $id], ['name' => $name, 'is_deleted' => 0, 'merchant_id' => 1, 'type' => $type, 'parent_id' => $parent_id]])->exists();
if (!empty($check)) {
Error('分组名已存在');
}
Expand Down
7 changes: 3 additions & 4 deletions modules/gallery/api/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace gallery\api;

use framework\common\BasicController;
use app\components\Upload;
use framework\common\BasicController;
use Yii;
use yii\data\ActiveDataProvider;

Expand Down Expand Up @@ -291,7 +291,6 @@ public function upload()
$thumbnail = $upload->image_compress($file['url']);
$data['thumbnail'] = $upload::$upload_way == 0 ? URL_STRING . $thumbnail : $thumbnail;


} elseif ($type == 2) {

$content = $_FILES['content'];
Expand All @@ -308,7 +307,7 @@ public function upload()
$cover = Yii::$app->request->post('cover', false);
if (strlen($cover) > 100) {
$cover_url = $upload->image_base64($cover);
$data['thumbnail'] = $upload::$upload_way == 0 ? URL_STRING . $cover_url['url'] : $cover_url['url'];
$data['thumbnail'] = $upload::$upload_way == 0 ? URL_STRING . $cover_url['url'] : $cover_url['url'];
} else {
$data['thumbnail'] = URL_STRING . '/static/images/gallery/video.png';
}
Expand Down Expand Up @@ -342,7 +341,7 @@ public function checkAccess($operation, $params = array(), $allowCaching = true)
$post['group_id'] = 1;
}
$get_url = $this->upload();
$post['title'] = $get_url['title'];
$post['title'] = $post['title'] ?? $get_url['title'];
$post['size'] = $get_url['size'];
$post['url'] = $get_url['url'];
$post['thumbnail'] = $get_url['thumbnail'] ?? '';
Expand Down
2 changes: 1 addition & 1 deletion modules/goods/app/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static function reduceStocks($event)
*/
public static function addStocks($event)
{
foreach ($event->order_goods as $value) {
foreach ($event->cancel_order_goods as $value) {
M('goods', 'GoodsData')::updateAllCounters(['stocks' => $value['goods_number']], ['goods_id' => $value['goods_id'], 'param_value' => $value['goods_param']]);
M()::updateAllCounters(['stocks' => $value['goods_number']], ['id' => $value['goods_id']]);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/goods/models/Goods.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function rules()
return [
//基本信息设置
[['name', 'group', 'slideshow', 'is_video', 'merchant_id', 'AppID'], 'required', 'message' => '{attribute}不能为空'],
[['video', 'video_cover'], 'required',
[['video'], 'required',
'when' => function ($model) {
return $model->is_video === 1 ? true : false;
}, 'message' => '{attribute}不能为空'],
Expand Down
33 changes: 28 additions & 5 deletions modules/order/api/AfterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ public function actionSearch()

$list = $data->getModels();
foreach ($list as $key => &$value) {
$value['images'] = to_array($value['images']);
$value['images'] = to_array($value['images']);
$value['merchant_freight_info'] = to_array($value['merchant_freight_info']);
}
//将所有返回内容中的本地地址代替字符串替换为域名
$list = str2url($list);
Expand Down Expand Up @@ -361,10 +362,13 @@ public function actionUpdate()
$model = $this->refund();
break;
case 'salesreturn': //退货退款
$model = $this->salesreturn();
$model = $this->salesReturn();
break;
case 'salesexchange': //换货
$model = $this->salesexchange();
$model = $this->salesExchange();
break;
case 'exchangefreight': //换货物流
$model = $this->exchangeFreight();
break;
default:
Error('未定义操作');
Expand Down Expand Up @@ -534,7 +538,7 @@ public function refund()
* 退货退款
* @return [type] [description]
*/
public function salesreturn()
public function salesReturn()
{
$id = Yii::$app->request->get('id', false);
$actual_refund = Yii::$app->request->post('actual_refund', false);
Expand Down Expand Up @@ -598,7 +602,7 @@ public function salesreturn()
* 换货
* @return [type] [description]
*/
public function salesexchange()
public function salesExchange()
{
$id = Yii::$app->request->get('id', false);
$model = $this->modelClass::findOne($id);
Expand Down Expand Up @@ -642,6 +646,25 @@ public function salesexchange()
}
}

/**
* 修改换货物流
*/
public function exchangeFreight()
{
$id = Yii::$app->request->get('id', false);
$model = $this->modelClass::findOne($id);
if (empty($model)) {
Error('售后订单不存在');
}
$merchant_freight_info = Yii::$app->request->post('merchant_freight_info', []);
$model->merchant_freight_info = to_json($merchant_freight_info);
if ($model->save()) {
return $model;
} else {
Error('修改失败');
}
}

public function orderFinishCheck($order_sn)
{
$order_after_goods_number = M('order', 'OrderAfter')::find()->where(['order_sn' => $order_sn, 'status' => 200])->sum('return_number');
Expand Down
10 changes: 9 additions & 1 deletion modules/setting/api/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ public function actionView()

public function actionUpdate()
{
return '占位方法';
$merchant_id = 1;
$AppID = Yii::$app->params['AppID'];
$where = [
'merchant_id' => $merchant_id,
'AppID' => $AppID,
'keyword'=>'web_setting'
];
$data = M()::find()->where($where)->select('keyword,content')->asArray()->one();
return str2url(to_array($data['content']));
}

public function actionDelete()
Expand Down
2 changes: 1 addition & 1 deletion modules/setting/app/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function actionSearch()
}
return str2url($data);
} else {
Error('设置不存在');
return null;
}
}
}
Loading

0 comments on commit df84b87

Please sign in to comment.