SchoolPhysicalExamination/application/admin/controller/Kitchenscale.php

62 lines
2.5 KiB
PHP

<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use app\bj\controller\Common;
use think\Log;
use \think\Validate;
class Kitchenscale extends Base{
protected $page_num = 10;
protected $kitchenscale_db_msg = [
'cookbook'=>'app_user_cookbook',//菜谱表
'cookbook_label'=>'app_user_cookbook_label',//菜谱标签表
'uploadimg'=>'app_user_upload_img',//素材表
'followlist'=>'app_user_follow_list',//关注列表
'collect_list'=>'app_user_collect_list',//收藏列表
'foodlist1'=>'app_food_type_one',//食材列表3
'foodlist2'=>'app_food_type_two',//食材列表3
'foodlist3'=>'app_food_type_three',//食材列表3
'user_kcal_log'=>'app_user_kcal_log',//食材列表3
'user'=>'app_user_data',//banner
];
################################################################食材管理################################################################
################################################################食材管理################################################################
################################################################食材管理################################################################
public function food_ingredients_index_1($page = 1){
$data = input();
$pd = true;
$parameter = [];
if(array_key_exists('tt', $data)){
$page = $data['page_num'];
unset($data['page_num']);
unset($data['tt']);
$pd = false;
}
$cfc = Db::connect('cfc_db');
$num = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->count();
$result = $cfc->table($this->kitchenscale_db_msg['foodlist1'])->order('is_del,id')->select();
if(!$pd){
$result['num'] = $num;
$result['data'] = $result;
return $this->msg(0,'success',$result);
}
$this->assign([
'result' => $result,
'num' => $num,
]);
return $this->fetch();
}
################################################################other################################################################
################################################################other################################################################
################################################################other################################################################
}