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();
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)
->where($where)
->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) {
$find = Goods::where('id', $item['goods_id'])->with('unitName')->find();
if($find){

View File

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

View File

@ -7,6 +7,7 @@ use app\admin\validate\tools\GenerateTableValidate;
use app\admin\logic\tools\GeneratorLogic;
use app\common\model\goods\Goods;
use app\common\model\goods\Goodsclass;
use app\common\model\retail\Cashierclass;
use app\common\service\pay\PayService;
use app\common\service\PushService;
use app\common\service\wechat\WeChatMnpService;
@ -22,6 +23,7 @@ use Yansongda\Pay\Pay;
use Webman\Push\Api;
use JPush\Client as JPush;
use support\Log;
use support\Redis as SupportRedis;
class IndexController extends BaseApiController
{
@ -29,6 +31,18 @@ class IndexController extends BaseApiController
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 = [];
// foreach ($a as $k => $v) {