feat: 添加修改密码功能/修改商品出价排序/更新密码更新逻辑

This commit is contained in:
mkm 2024-05-25 16:37:01 +08:00
parent c121603686
commit 1549adfed6
4 changed files with 34 additions and 7 deletions

View File

@ -211,4 +211,17 @@ class MerchantController extends BaseAdminController
$count = Db::name('merchant_bind_goods')->where('mer_id', $mer_id)->count(); $count = Db::name('merchant_bind_goods')->where('mer_id', $mer_id)->count();
return $this->success('请求成功', ['lists' => $data, 'count' => $count, 'page_no' => $page_no, 'page_size' => $page_size]); return $this->success('请求成功', ['lists' => $data, 'count' => $count, 'page_no' => $page_no, 'page_size' => $page_size]);
} }
/**
* @notes 修改密码
*/
function edit_password()
{
$params = $this->request->post();
$result = MerchantLogic::editPassword($params);
if (true === $result) {
return $this->success('修改成功', [], 1, 1);
}
return $this->fail(MerchantLogic::getError());
}
} }

View File

@ -66,7 +66,7 @@ class OpurchaseclassofferLists extends BaseAdminDataLists implements ListsSearch
return OpurchaseGoodsOffer::where($this->searchWhere) return OpurchaseGoodsOffer::where($this->searchWhere)
->where($where) ->where($where)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->orderRaw("goods_id, CASE WHEN price = 0 THEN 999999999 ELSE price END ASC")
->select()->each(function ($item) { ->select()->each(function ($item) {
$find = Goods::where('id', $item['goods_id'])->with('unitName')->find(); $find = Goods::where('id', $item['goods_id'])->with('unitName')->find();
if($find){ if($find){

View File

@ -208,12 +208,12 @@ class MerchantLogic extends BaseLogic
{ {
Db::startTrans(); Db::startTrans();
try { try {
// $admin_id=Db::name('user_auth_shop')->where(['type'=>2,'pid'=>$params['id']])->value('admin_id'); $uid=Merchant::where(['mer_id'=>$params['mer_id']])->value('uid');
// if($admin_id){ if($uid){
// $passwordSalt = Config::get('project.unique_identification'); $passwordSalt = Config::get('project.unique_identification');
// $password=create_password($params['password'], $passwordSalt); $password=create_password($params['password'], $passwordSalt);
// Admin::where('id',$admin_id)->update(['password'=>$password]); User::where('id',$uid)->update(['password'=>$password]);
// } }
Db::commit(); Db::commit();
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -7,6 +7,7 @@ use app\admin\validate\tools\GenerateTableValidate;
use app\admin\logic\tools\GeneratorLogic; use app\admin\logic\tools\GeneratorLogic;
use app\common\model\goods\Goods; use app\common\model\goods\Goods;
use app\common\model\goods\Goodsclass; use app\common\model\goods\Goodsclass;
use app\common\model\retail\Cashierclass;
use app\common\service\pay\PayService; use app\common\service\pay\PayService;
use app\common\service\PushService; use app\common\service\PushService;
use app\common\service\wechat\WeChatMnpService; use app\common\service\wechat\WeChatMnpService;
@ -22,6 +23,7 @@ use Yansongda\Pay\Pay;
use Webman\Push\Api; use Webman\Push\Api;
use JPush\Client as JPush; use JPush\Client as JPush;
use support\Log; use support\Log;
use support\Redis as SupportRedis;
class IndexController extends BaseApiController class IndexController extends BaseApiController
{ {
@ -29,6 +31,18 @@ class IndexController extends BaseApiController
public function index() public function index()
{ {
Redis::send('push-platform-print', ['order_id' => 39]);
// $auth_code=$this->request->get('auth_code');
// $config = Config::get('payment');
// Pay::config($config);
// $result = Pay::alipay()->pos([
// 'out_trade_no' => time(),
// 'auth_code' => $auth_code,
// 'total_amount' => '0.01',
// 'subject' => 'yansongda 测试 - 01',
// 'extend_params'=>['attach'=>'cashierclass']
// ]);
// $arr = []; // $arr = [];
// foreach ($a as $k => $v) { // foreach ($a as $k => $v) {