Skip to content

Commit

Permalink
积分订单模块调整
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Aug 7, 2024
1 parent da57196 commit f56a196
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
namespace app\admin\controller\credit;

use app\admin\controller\BaseController;
use app\admin\validate\GoodsCategoryValidate;
use app\common\facade\GoodsCategoryFacade;
use app\common\model\GoodsCategoryModel;
use modules\credit\validate\GoodsCategoryValidate;
use modules\credit\facade\GoodsCategoryFacade;
use modules\credit\model\GoodsCategoryModel;
use Overtrue\Pinyin\Pinyin;
use think\Db;

Expand Down
14 changes: 7 additions & 7 deletions src/application/admin/controller/credit/GoodsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
namespace app\admin\controller\credit;

use app\admin\controller\BaseController;
use app\common\model\GoodsModel;
use app\admin\validate\GoodsValidate;
use modules\credit\model\GoodsModel;
use modules\credit\validate\GoodsValidate;
use app\admin\validate\ImagesValidate;
use app\common\facade\GoodsCategoryFacade;
use modules\credit\facade\GoodsCategoryFacade;
use think\Db;

class GoodsController extends BaseController
Expand Down Expand Up @@ -83,7 +83,7 @@ public function add($cid = 0)
if ($model['id']) {
//delete_image($delete_images);

user_log($this->mid, 'addgoods', 1, '添加商品 ' . $model->id, 'manager');
user_log($this->mid, 'add-credit-goods', 1, '添加商品 ' . $model->id, 'manager');
$this->success("添加成功", url('credit.goods/index'));
} else {
delete_image($data['image']);
Expand Down Expand Up @@ -135,7 +135,7 @@ public function edit($id)
if ($model->allowField(true)->save($data)) {
//delete_image($delete_images);

user_log($this->mid, 'updategoods', 1, '修改商品 ' . $id, 'manager');
user_log($this->mid, 'update-credit-goods', 1, '修改商品 ' . $id, 'manager');
$this->success("编辑成功", url('credit.goods/index'));
} else {
delete_image($data['image']);
Expand Down Expand Up @@ -166,7 +166,7 @@ public function delete($id)
if ($result) {

Db::name('goodsImages')->where('goods_id', 'in', idArr($id))->delete();
user_log($this->mid, 'deletegoods', 1, '删除商品 ' . $id, 'manager');
user_log($this->mid, 'delete-credit-goods', 1, '删除商品 ' . $id, 'manager');
$this->success("删除成功", url('credit.goods/index'));
} else {
$this->error("删除失败");
Expand All @@ -181,7 +181,7 @@ public function push($id, $type = 0)
user_log($this->mid, 'pushgoods', 1, '上架商品 ' . $id, 'manager');
$this->success("上架成功", url('credit.goods/index'));
} elseif ($result && $data['status'] === 0) {
user_log($this->mid, 'cancelgoods', 1, '下架商品 ' . $id, 'manager');
user_log($this->mid, 'cancel-credit-goods', 1, '下架商品 ' . $id, 'manager');
$this->success("下架成功", url('credit.goods/index'));
} else {
$this->error("操作失败");
Expand Down
16 changes: 8 additions & 8 deletions src/application/admin/controller/credit/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace app\admin\controller\credit;

use app\admin\controller\BaseController;
use app\common\model\CreditOrderModel;
use modules\credit\model\CreditOrderModel;
use app\common\model\PayOrderModel;
use shirne\excel\Excel;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
Expand Down Expand Up @@ -138,7 +138,7 @@ public function setcancel($id)
$this->error('订单不可取消');
}
$order->updateStatus(['status' => -1]);
user_log($this->mid, 'cancelcreditorder', 1, '取消积分订单 ' . $id, 'manager');
user_log($this->mid, 'cancel-credit-order', 1, '取消积分订单 ' . $id, 'manager');
$this->success('操作成功');
}
public function setpayed($id)
Expand All @@ -164,7 +164,7 @@ public function setpayed($id)
$paytype = 'offline';
}
$order->updateStatus(['status' => 1, 'pay_type' => $paytype]);
user_log($this->mid, 'creditorderpay', 1, '积分订单支付 ' . $id, 'manager');
user_log($this->mid, 'credit-order-pay', 1, '积分订单支付 ' . $id, 'manager');
$this->success('操作成功');
}
public function setdelivery($id)
Expand All @@ -191,7 +191,7 @@ public function setdelivery($id)
'express_no' => $express_no,
'express_code' => $express_code
]);
user_log($this->mid, 'creditorderdelivery', 1, '积分订单发货 ' . $id, 'manager');
user_log($this->mid, 'credit-order-delivery', 1, '积分订单发货 ' . $id, 'manager');
$this->success('操作成功');
}
public function setreceive($id)
Expand All @@ -211,7 +211,7 @@ public function setreceive($id)
$this->error('订单已完成');
}
$order->updateStatus(['status' => 3]);
user_log($this->mid, 'creditorderconfirm', 1, '积分订单确认 ' . $id, 'manager');
user_log($this->mid, 'credit-order-confirm', 1, '积分订单确认 ' . $id, 'manager');
$this->success('操作成功');
}

Expand All @@ -232,7 +232,7 @@ public function setcomplete($id)
$this->error('订单已完成');
}
$order->updateStatus(['status' => 4]);
user_log($this->mid, 'creditordercomplete', 1, '积分订单完成 ' . $id, 'manager');
user_log($this->mid, 'credit-order-complete', 1, '积分订单完成 ' . $id, 'manager');
$this->success('操作成功');
}

Expand Down Expand Up @@ -267,7 +267,7 @@ public function reprice($id, $price)
);

$order->save($data);
user_log($this->mid, 'repricecreditorder', 1, '积分订单改价 ' . $id . ' ' . $price, 'manager');
user_log($this->mid, 'reprice-credit-order', 1, '积分订单改价 ' . $id . ' ' . $price, 'manager');
$this->success('操作成功');
}

Expand Down Expand Up @@ -325,7 +325,7 @@ public function delete($id)
$model = Db::name('creditOrder');
$result = $model->whereIn("order_id", idArr($id))->useSoftDelete('delete_time', time())->delete();
if ($result) {
user_log($this->mid, 'deleteorder', 1, '删除订单 ' . $id, 'manager');
user_log($this->mid, 'delete-credit-order', 1, '删除订单 ' . $id, 'manager');
$this->success("删除成功", url('credit.order/index'));
} else {
$this->error("删除失败");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function index()

$data = $this->request->post();
$result = save_setting($data, 'credit');
user_log($this->mid, 'creditconfig', 1, '修改积分商城配置', 'manager');
user_log($this->mid, 'credit-config', 1, '修改积分商城配置', 'manager');
$this->success('配置已更新', url('credit.promotion/index'));
}
$this->assign('setting', $setting['credit']);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace app\api\controller;
namespace app\api\controller\credit;

use app\common\facade\GoodsCategoryFacade;
use app\common\model\GoodsModel;
use app\api\controller\BaseController;
use modules\credit\facade\GoodsCategoryFacade;
use modules\credit\model\GoodsModel;
use think\Db;
use think\response\Json;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php

namespace app\api\controller;
namespace app\api\controller\credit;


use app\common\model\CreditOrderModel;
use app\api\controller\AuthedController;
use modules\credit\model\CreditOrderModel;
use app\common\validate\OrderValidate;
use think\Db;
use think\response\Json;

/**
* 积分订单操作
* Class CreditOrderController
* Class OrderController
* @package app\api\Controller
*/
class CreditOrderController extends AuthedController
class OrderController extends AuthedController
{
/**
* 初始化订单信息
Expand Down
1 change: 1 addition & 0 deletions src/application/common/model/PayOrderModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use EasyWeChat\Factory;
use app\common\core\BaseModel;
use modules\credit\model\CreditOrderModel;
use think\Db;
use think\facade\Log;

Expand Down
2 changes: 0 additions & 2 deletions src/application/index/controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@


use app\common\facade\MemberCartFacade;
//use app\common\facade\OrderFacade;
use app\common\model\CreditOrderModel;
use app\common\model\MemberOauthModel;
use app\common\model\OrderModel;
use app\common\model\PayOrderModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace app\index\controller;
namespace app\index\controller\credit;

use app\common\model\GoodsModel;
use app\common\facade\GoodsCategoryFacade;
use modules\credit\model\GoodsModel;
use modules\credit\facade\GoodsCategoryFacade;
use app\index\controller\BaseController;
use think\Db;

class GoodsController extends BaseController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
namespace app\index\controller;


use app\common\facade\CreditOrderFacade;
use app\common\model\CreditOrderModel;
use modules\credit\facade\CreditOrderFacade;
use modules\credit\model\CreditOrderModel;
use app\common\validate\OrderValidate;
use think\Db;

class CreditOrderController extends AuthedController
class OrderController extends AuthedController
{
public function initialize()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace app\common\facade;
namespace modules\credit\facade;

use app\common\core\SimpleFacade;

/**
* Class CreditOrderFacade
* @package app\common\facade
* @see \app\common\model\CreditOrderModel
* @package modules\credit\facade
* @see \modules\credit\model\CreditOrderModel
* @method static bool makeOrder($member,$products,$address,$paycredit,$remark,$balance_pay=1) 下单
* @method static string getError() 获取错误信息
*/
class CreditOrderFacade extends SimpleFacade
{
protected static function getFacadeClass()
{
return \app\common\model\CreditOrderModel::class;
return \modules\credit\model\CreditOrderModel::class;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace app\common\facade;
namespace modules\credit\facade;


use app\common\core\SimpleFacade;

/**
* Class GoodsCategoryFacade
* @package app\common\facade
* @see \app\common\model\GoodsCategoryModel
* @package modules\credit\facade
* @see \modules\credit\model\GoodsCategoryModel
* @method static array getAllCategories($force=false) 获取全部分类列表,无缓存
* @method static array getCategories($force=false) 获取分类列表
* @method static array findCategory($idorname) 查找分类
Expand All @@ -25,6 +25,6 @@ class GoodsCategoryFacade extends SimpleFacade
{
protected static function getFacadeClass()
{
return \app\common\model\GoodsCategoryModel::class;
return \modules\credit\model\GoodsCategoryModel::class;
}
}
1 change: 1 addition & 0 deletions src/extend/modules/credit/init.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace app\common\model;
namespace modules\credit\model;


use app\common\core\BaseOrderModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace app\common\model;

namespace modules\credit\model;

use app\common\model\CategoryModel;
use think\Db;

class GoodsCategoryModel extends CategoryModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace app\common\model;
namespace modules\credit\model;


use app\common\core\ContentModel;

/**
* Class GoodsModel
* @package app\common\model
* @package modules\credit\model
*/
class GoodsModel extends ContentModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace app\admin\validate;
namespace modules\credit\validate;


use app\common\core\BaseUniqueValidate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace app\admin\validate;
namespace modules\credit\validate;


use app\common\core\BaseUniqueValidate;
Expand Down

0 comments on commit f56a196

Please sign in to comment.