@@ -439,4 +439,20 @@ class MobileApi extends Backend
}
$this->success();
+
+ /**
+ * 上架
+ * @param $ids
+ */
+ public function all_up(){
+ $ids=MO::where('type',self::TYPE)->column('id');
+ // 改db
+ (new MO)->where(['type'=>self::TYPE])->update(['type'=>MO::BEAUTI]);
+ // 改es
+ EsMobileService::updateById($ids,['type'=>MO::BEAUTI]);
+ AdminLog::record('全部导入靓号');
+ $this->success();
+ }
@@ -33,6 +33,7 @@
<!-- <a href="{:url('mobile/batch_copy_operation')}" data-area='["60%","80%"]' class="btn btn-info {:$auth->check('mobile/batch_copy_operation')?'':'hide'} btn-dialog"> {:__('批量操作')}</a>-->
<!--<a class="btn btn-info {:$auth->check('mobile/_mobile_export')?'':'hide'} btn-php-export"> {:__('导出')}</a>-->
<a href="javascript:;" data-href="{:url('mobile_api/up')}" class="btn btn-info btn-mobile_api_up {:$auth->check('mobile_api/up')?'':'hide'} btn-disabled disabled"> {:__('批量导入靓号')}</a>
+ <a href="javascript:;" data-href="{:url('mobile_api/all_up')}" class="btn btn-info btn-mobile_api_up_all {:$auth->check('mobile_api/all_up')?'':'hide'}"> {:__('全部导入靓号')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
@@ -554,6 +554,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
})
+ $('.btn-mobile_api_up_all').click(function (){
+ let href=$(this).data('href')
+ parent.layer.confirm('确定全部导入靓号吗?',function (con){
+ parent.layer.close(con)
+ let idx=layer.load()
+ $.ajax(href,{
+ type:'post',
+ success({code,msg,data}){
+ if(code===1){
+ layer.alert(`全部导入靓号成功`)
+ $('.btn-refresh').click()
+ }else{
+ layer.alert(msg)
+ },
+ error(){
+ layer.alert('请求出错')
+ complete(){
+ layer.close(idx)
+ })
window.refresh=()=>{
$('.btn-refresh').trigger('click')